|
@@ -26,6 +26,7 @@ import {
|
26
|
26
|
conferenceFailed,
|
27
|
27
|
conferenceJoined,
|
28
|
28
|
conferenceLeft,
|
|
29
|
+ toggleAudioOnly,
|
29
|
30
|
EMAIL_COMMAND,
|
30
|
31
|
lockStateChanged
|
31
|
32
|
} from './react/features/base/conference';
|
|
@@ -459,11 +460,14 @@ export default {
|
459
|
460
|
* Creates local media tracks and connects to a room. Will show error
|
460
|
461
|
* dialogs in case accessing the local microphone and/or camera failed. Will
|
461
|
462
|
* show guidance overlay for users on how to give access to camera and/or
|
462
|
|
- * microphone,
|
|
463
|
+ * microphone.
|
463
|
464
|
* @param {string} roomName
|
464
|
465
|
* @param {object} options
|
465
|
|
- * @param {boolean} options.startScreenSharing - if <tt>true</tt> should
|
466
|
|
- * start with screensharing instead of camera video.
|
|
466
|
+ * @param {boolean} options.startAudioOnly=false - if <tt>true</tt> then
|
|
467
|
+ * only audio track will be created and the audio only mode will be turned
|
|
468
|
+ * on.
|
|
469
|
+ * @param {boolean} options.startScreenSharing=false - if <tt>true</tt>
|
|
470
|
+ * should start with screensharing instead of camera video.
|
467
|
471
|
* @returns {Promise.<JitsiLocalTrack[], JitsiConnection>}
|
468
|
472
|
*/
|
469
|
473
|
createInitialLocalTracksAndConnect(roomName, options = {}) {
|
|
@@ -482,8 +486,18 @@ export default {
|
482
|
486
|
// First try to retrieve both audio and video.
|
483
|
487
|
let tryCreateLocalTracks;
|
484
|
488
|
|
|
489
|
+ // FIXME there is no video muted indication visible on the remote side,
|
|
490
|
+ // after starting in audio only (there's no video track)
|
485
|
491
|
// FIXME the logic about trying to go audio only on error is duplicated
|
486
|
|
- if (options.startScreenSharing) {
|
|
492
|
+ if (options.startAudioOnly) {
|
|
493
|
+ tryCreateLocalTracks
|
|
494
|
+ = createLocalTracks({ devices: ['audio'] }, true)
|
|
495
|
+ .catch(err => {
|
|
496
|
+ audioOnlyError = err;
|
|
497
|
+
|
|
498
|
+ return [];
|
|
499
|
+ });
|
|
500
|
+ } else if (options.startScreenSharing) {
|
487
|
501
|
tryCreateLocalTracks = this._createDesktopTrack()
|
488
|
502
|
.then(desktopStream => {
|
489
|
503
|
return createLocalTracks({ devices: ['audio'] }, true)
|
|
@@ -591,6 +605,7 @@ export default {
|
591
|
605
|
analytics.init();
|
592
|
606
|
return this.createInitialLocalTracksAndConnect(
|
593
|
607
|
options.roomName, {
|
|
608
|
+ startAudioOnly: config.startAudioOnly,
|
594
|
609
|
startScreenSharing: config.startScreenSharing
|
595
|
610
|
});
|
596
|
611
|
}).then(([tracks, con]) => {
|
|
@@ -649,6 +664,15 @@ export default {
|
649
|
664
|
this.updateVideoIconEnabled();
|
650
|
665
|
}
|
651
|
666
|
|
|
667
|
+ // Enable audio only mode
|
|
668
|
+ if (config.startAudioOnly) {
|
|
669
|
+ // It is important to have that toggled after video muted
|
|
670
|
+ // state is adjusted by the code about lack of video tracks
|
|
671
|
+ // above. That's because audio only will store muted state
|
|
672
|
+ // on toggle action.
|
|
673
|
+ APP.store.dispatch(toggleAudioOnly());
|
|
674
|
+ }
|
|
675
|
+
|
652
|
676
|
this._initDeviceList();
|
653
|
677
|
|
654
|
678
|
if (config.iAmRecorder)
|
|
@@ -2035,7 +2059,7 @@ export default {
|
2035
|
2059
|
JitsiMeetJS.mediaDevices.enumerateDevices(devices => {
|
2036
|
2060
|
// Ugly way to synchronize real device IDs with local
|
2037
|
2061
|
// storage and settings menu. This is a workaround until
|
2038
|
|
- // getConstraints() method will be implemented
|
|
2062
|
+ // getConstraints() method will be implemented
|
2039
|
2063
|
// in browsers.
|
2040
|
2064
|
if (localAudio) {
|
2041
|
2065
|
APP.settings.setMicDeviceId(
|