瀏覽代碼

ref(conference): use options in init tracks

master
paweldomas 8 年之前
父節點
當前提交
3fbb022ffb
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8
    6
      conference.js

+ 8
- 6
conference.js 查看文件

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

Loading…
取消
儲存