How to use the openvidu-browser.OpenVidu function in openvidu-browser

To help you get started, we’ve selected a few openvidu-browser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenVidu / full-teaching / src / main / angular / src / app / components / video-session / video-session.component.ts View on Github external
joinSession() {
    this.OV = new OpenVidu();
    this.OVSession = this.OV.initSession();

    this.OVSession.on('streamCreated', (event: StreamEvent) => {
      console.warn("OpenVidu stream created: ", event.stream);

      this.OVSession.subscribe(event.stream, 'nothing');

      let stream: Stream = event.stream;
      if (JSON.parse(stream.connection.data).isTeacher) {
        // Teacher's stream
        this.teacherStream = stream;
        if (this.studentAccessGranted) {
          // There's a student publishing: setup the 2 videos
          this.smallStream = stream;
        } else {
          // There's no student publishing: setup only big video for the teacher
github OpenVidu / openvidu-tutorials / openvidu-ionic / src / app / app.component.ts View on Github external
joinSession() {
        // --- 1) Get an OpenVidu object ---

        this.OV = new OpenVidu();

        // --- 2) Init a session ---

        this.session = this.OV.initSession();

        // --- 3) Specify the actions when events take place in the session ---

        // On every new Stream received...
        this.session.on('streamCreated', (event: StreamEvent) => {
            // Subscribe to the Stream to receive it. Second parameter is undefined
            // so OpenVidu doesn't create an HTML video on its own
            const subscriber: Subscriber = this.session.subscribe(event.stream, undefined);
            this.subscribers.push(subscriber);
        });

        // On every Stream destroyed...
github OpenVidu / openvidu-tutorials / openvidu-insecure-react / src / App.js View on Github external
joinSession() {
        // --- 1) Get an OpenVidu object ---

        this.OV = new OpenVidu();

        // --- 2) Init a session ---

        this.setState(
            {
                session: this.OV.initSession(),
            },
            () => {
                var mySession = this.state.session;

                // --- 3) Specify the actions when events take place in the session ---

                // On every new Stream received...
                mySession.on('streamCreated', (event) => {
                    // Subscribe to the Stream to receive it. Second parameter is undefined
                    // so OpenVidu doesn't create an HTML video by its own
github OpenVidu / openvidu-tutorials / openvidu-react-native / App.js View on Github external
joinSession() {
        // --- 1) Get an OpenVidu object ---

        this.OV = new OpenVidu();

        // --- 2) Init a session ---

        this.setState(
            {
                session: this.OV.initSession(),
            },
            () => {
                var mySession = this.state.session;
                // --- 3) Specify the actions when events take place in the session ---

                // On every new Stream received...
                mySession.on('streamCreated', (event) => {
                    // Subscribe to the Stream to receive it. Second parameter is undefined
                    // so OpenVidu doesn't create an HTML video by its own
                    const subscriber = mySession.subscribe(event.stream, undefined);
github OpenVidu / openvidu / openvidu-ng-testapp / src / app / app.component.ts View on Github external
joinSessionShared(cameraOptions) {

    this.toggleVideo = this.joinWithVideo;
    this.toggleAudio = this.joinWithAudio;

    this.openVidu = new OpenVidu("wss://" + location.hostname + ":8443/");

    this.openVidu.connect((error, openVidu) => {

      if (error)
        return console.log(error);

      let camera = openVidu.getCamera(cameraOptions);

      camera.requestCameraAccess((error, camera) => {

        if (error)
          return console.log(error);

        var sessionOptions = {
          sessionId: this.sessionId,
          participantId: this.participantId
github OpenVidu / openvidu / openvidu-testapp / src / app / components / openvidu-instance / openvidu-instance.component.ts View on Github external
private joinSessionShared(token): void {

    this.OV = new OpenVidu();

    this.session = this.OV.initSession();

    this.addSessionEvents(this.session);

    this.session.connect(token, this.clientData)
      .then(() => {
        this.changeDetector.detectChanges();

        if (this.publishTo) {

          this.audioMuted = !this.activeAudio;
          this.videoMuted = !this.activeVideo;
          this.unpublished = false;
          this.updateAudioIcon();
          this.updateVideoIcon();
github OpenVidu / openvidu / openvidu-testapp / src / app / components / test-scenarios / test-scenarios.component.ts View on Github external
this.getToken().then(token => {

        const startTimeForUser = Date.now();

        const OV = new OpenVidu();

        if (this.turnConf === 'freeice') {
          OV.setAdvancedConfiguration({ iceServers: 'freeice' });
        } else if (this.turnConf === 'manual') {
          OV.setAdvancedConfiguration({ iceServers: [this.manualTurnConf] });
        }
        const session = OV.initSession();

        this.OVs.push(OV);
        this.sessions.push(session);

        session.on('connectionCreated', (event: ConnectionEvent) => {
          if (this.connections.indexOf(event.connection.connectionId) === -1) {
            this.connections.push(event.connection.connectionId);
          }
        });
github OpenVidu / openvidu-call / front / openvidu-call / src / app / video-room / video-room.component.ts View on Github external
joinSession() {
    this.OV = new OpenVidu();
    this.session = this.OV.initSession();

    this.subscribeToUserChanged();
    this.subscribeToStreamCreated();
    this.subscribedToStreamDestroyed();
    this.connectToSession();
  }
github OpenVidu / openvidu / openvidu-server / src / dashboard / src / app / components / dashboard / dashboard.component.ts View on Github external
connectToSession(token: string) {
    this.msgChain = [];

    const OV = new OpenVidu();
    this.session = OV.initSession();

    this.testStatus = 'CONNECTING';
    this.testButton = 'Testing...';

    this.session.connect(token)
      .then(() => {

        this.msgChain.push('Connected to session');

        this.testStatus = 'CONNECTED';

        const publisherRemote = OV.initPublisher('mirrored-video', {
          publishAudio: true,
          publishVideo: true,
          resolution: '640x480'

openvidu-browser

OpenVidu Browser

Apache-2.0
Latest version published 6 months ago

Package Health Score

63 / 100
Full package analysis

Similar packages