Przeglądaj źródła

ref(conference): use options in init tracks

master
paweldomas 8 lat temu
rodzic
commit
3fbb022ffb
1 zmienionych plików z 8 dodań i 6 usunięć
  1. 8
    6
      conference.js

+ 8
- 6
conference.js Wyświetl plik

@@ -493,11 +493,12 @@ export default {
493 493
      * show guidance overlay for users on how to give access to camera and/or
494 494
      * microphone,
495 495
      * @param {string} roomName
496
-     * @param {boolean} startScreenSharing - if <tt>true</tt> should start with
497
-     * screensharing instead of camera video.
496
+     * @param {object} options
497
+     * @param {boolean} options.startScreenSharing - if <tt>true</tt> should
498
+     * start with screensharing instead of camera video.
498 499
      * @returns {Promise.<JitsiLocalTrack[], JitsiConnection>}
499 500
      */
500
-    createInitialLocalTracksAndConnect(roomName, startScreenSharing) {
501
+    createInitialLocalTracksAndConnect(roomName, options = {}) {
501 502
         let audioAndVideoError,
502 503
             audioOnlyError,
503 504
             screenSharingError,
@@ -514,7 +515,7 @@ export default {
514 515
         let tryCreateLocalTracks;
515 516
 
516 517
         // FIXME the logic about trying to go audio only on error is duplicated
517
-        if (startScreenSharing) {
518
+        if (options.startScreenSharing) {
518 519
             tryCreateLocalTracks = this._createDesktopTrack()
519 520
                 .then(desktopStream => {
520 521
                     return createLocalTracks({ devices: ['audio'] }, true)
@@ -621,8 +622,9 @@ export default {
621 622
             ).then(() => {
622 623
                 analytics.init();
623 624
                 return this.createInitialLocalTracksAndConnect(
624
-                    options.roomName,
625
-                    config.startScreenSharing);
625
+                    options.roomName, {
626
+                        startScreenSharing: config.startScreenSharing
627
+                    });
626 628
             }).then(([tracks, con]) => {
627 629
                 tracks.forEach(track => {
628 630
                     if((track.isAudioTrack() && initialAudioMutedState)

Ładowanie…
Anuluj
Zapisz