From 3fd68fa0fd2fd66810f7e54359e28f167752c7a7 Mon Sep 17 00:00:00 2001 From: damencho Date: Mon, 11 Jan 2016 18:14:01 -0600 Subject: [PATCH] Renames all active speaker references to be called dominant speaker. --- conference.js | 4 ++-- css/videolayout_default.css | 6 +++--- index.html | 6 +++--- interface_config.js | 2 +- libs/lib-jitsi-meet.js | 28 ++++++++++++++++++++------ modules/UI/UI.js | 2 +- modules/UI/audio_levels/AudioLevels.js | 16 +++++++-------- modules/UI/avatar/Avatar.js | 4 ++-- modules/UI/videolayout/LargeVideo.js | 8 ++++---- 9 files changed, 46 insertions(+), 30 deletions(-) diff --git a/conference.js b/conference.js index 107d907ff..83185a45f 100644 --- a/conference.js +++ b/conference.js @@ -361,8 +361,8 @@ export default { room.on(ConferenceEvents.LAST_N_ENDPOINTS_CHANGED, (ids) => { APP.UI.handleLastNEndpoints(ids); }); - room.on(ConferenceEvents.ACTIVE_SPEAKER_CHANGED, (id) => { - APP.UI.markDominantSpiker(id); + room.on(ConferenceEvents.DOMINANT_SPEAKER_CHANGED, (id) => { + APP.UI.markDominantSpeaker(id); }); if (!interfaceConfig.filmStripOnly) { diff --git a/css/videolayout_default.css b/css/videolayout_default.css index 2935fcab9..96213fdac 100644 --- a/css/videolayout_default.css +++ b/css/videolayout_default.css @@ -407,7 +407,7 @@ pointer-events: none; } -#activeSpeaker { +#dominantSpeaker { visibility: hidden; width: 150px; height: 150px; @@ -416,7 +416,7 @@ position: relative; } -#activeSpeakerAudioLevel { +#dominantSpeakerAudioLevel { position: absolute; top: 0px; left: 0px; @@ -428,7 +428,7 @@ display:none !important; } -#activeSpeakerAvatar { +#dominantSpeakerAvatar { width: 100px; height: 100px; top: 25px; diff --git a/index.html b/index.html index e7c8af05d..993802d76 100644 --- a/index.html +++ b/index.html @@ -149,9 +149,9 @@ jitsi.org -
- - +
+ +
diff --git a/interface_config.js b/interface_config.js index 3078707e0..cb0e84b48 100644 --- a/interface_config.js +++ b/interface_config.js @@ -14,7 +14,7 @@ var interfaceConfig = { GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true, APP_NAME: "Jitsi Meet", INVITATION_POWERED_BY: true, - ACTIVE_SPEAKER_AVATAR_SIZE: 100, + DOMINANT_SPEAKER_AVATAR_SIZE: 100, TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop', 'recording', 'security', 'invite', 'chat', 'prezi', 'etherpad', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', diff --git a/libs/lib-jitsi-meet.js b/libs/lib-jitsi-meet.js index be2309da2..9685739e6 100644 --- a/libs/lib-jitsi-meet.js +++ b/libs/lib-jitsi-meet.js @@ -41,7 +41,7 @@ function JitsiConference(options) { this.statistics = new Statistics(); setupListeners(this); this.participants = {}; - this.lastActiveSpeaker = null; + this.lastDominantSpeaker = null; this.dtmfManager = null; this.somebodySupportsDTMF = false; this.authEnabled = false; @@ -745,9 +745,9 @@ function setupListeners(conference) { }); conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) { - if(conference.lastActiveSpeaker !== id && conference.room) { - conference.lastActiveSpeaker = id; - conference.eventEmitter.emit(JitsiConferenceEvents.ACTIVE_SPEAKER_CHANGED, id); + if(conference.lastDominantSpeaker !== id && conference.room) { + conference.lastDominantSpeaker = id; + conference.eventEmitter.emit(JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, id); } }); @@ -842,9 +842,9 @@ var JitsiConferenceEvents = { */ TRACK_REMOVED: "conference.trackRemoved", /** - * The active speaker was changed. + * The dominant speaker was changed. */ - ACTIVE_SPEAKER_CHANGED: "conference.activeSpeaker", + DOMINANT_SPEAKER_CHANGED: "conference.dominantSpeaker", /** * A new user joinned the conference. */ @@ -2893,6 +2893,9 @@ function obtainDevices(options) { obtainDevices(options); }, function (error) { + Object.keys(options.streams).forEach(function(device) { + RTCUtils.stopMediaStream(options.streams[device]); + }); logger.error( "failed to obtain " + device + " stream - stop", error); options.errorCallback(JitsiTrackErrors.parseError(error, devices)); @@ -3249,12 +3252,25 @@ var RTCUtils = { this.getUserMediaWithConstraints( options.devices, function (stream) { + if((options.devices.indexOf("audio") !== -1 && + !stream.getAudioTracks().length) || + (options.devices.indexOf("video") !== -1 && + !stream.getVideoTracks().length)) + { + self.stopMediaStream(stream); + reject(JitsiTrackErrors.parseError( + new Error("Unable to get the audio and " + + "video tracks."), + options.devices)); + return; + } if(hasDesktop) { screenObtainer.obtainStream( function (desktopStream) { successCallback({audioVideo: stream, desktopStream: desktopStream}); }, function (error) { + self.stopMediaStream(stream); reject( JitsiTrackErrors.parseError(error, options.devices)); diff --git a/modules/UI/UI.js b/modules/UI/UI.js index b7f9e1636..6bc4e010a 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -606,7 +606,7 @@ UI.notifyInitiallyMuted = function () { ); }; -UI.markDominantSpiker = function (id) { +UI.markDominantSpeaker = function (id) { VideoLayout.onDominantSpeakerChanged(id); }; diff --git a/modules/UI/audio_levels/AudioLevels.js b/modules/UI/audio_levels/AudioLevels.js index 0bc273ce0..0e2284a7a 100644 --- a/modules/UI/audio_levels/AudioLevels.js +++ b/modules/UI/audio_levels/AudioLevels.js @@ -9,9 +9,9 @@ const LOCAL_LEVEL = 'local'; let ASDrawContext = null; let audioLevelCanvasCache = {}; -function initActiveSpeakerAudioLevels() { - let ASRadius = interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE / 2; - let ASCenter = (interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE + ASRadius) / 2; +function initDominantSpeakerAudioLevels() { + let ASRadius = interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE / 2; + let ASCenter = (interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE + ASRadius) / 2; // Draw a circle. ASDrawContext.arc(ASCenter, ASCenter, ASRadius, 0, 2 * Math.PI); @@ -119,8 +119,8 @@ function getVideoSpanId(id) { const AudioLevels = { init () { - ASDrawContext = $('#activeSpeakerAudioLevel')[0].getContext('2d'); - initActiveSpeakerAudioLevels(); + ASDrawContext = $('#dominantSpeakerAudioLevel')[0].getContext('2d'); + initDominantSpeakerAudioLevels(); }, /** @@ -197,13 +197,13 @@ const AudioLevels = { if(id === largeVideoId) { window.requestAnimationFrame(function () { - AudioLevels.updateActiveSpeakerAudioLevel(audioLevel); + AudioLevels.updateDominantSpeakerAudioLevel(audioLevel); }); } }, - updateActiveSpeakerAudioLevel (audioLevel) { - if($("#activeSpeaker").css("visibility") == "hidden" || ASDrawContext === null) { + updateDominantSpeakerAudioLevel (audioLevel) { + if($("#domiantSpeaker").css("visibility") == "hidden" || ASDrawContext === null) { return; } diff --git a/modules/UI/avatar/Avatar.js b/modules/UI/avatar/Avatar.js index adaa85f36..6e6d7f983 100644 --- a/modules/UI/avatar/Avatar.js +++ b/modules/UI/avatar/Avatar.js @@ -21,10 +21,10 @@ var Avatar = { }, /** * Returns image URL for the avatar to be displayed on large video area - * where current active speaker is presented. + * where current dominant speaker is presented. * @param id id of the user for whom we want to obtain avatar URL */ - getActiveSpeakerUrl: function (id) { + getDominantSpeakerUrl: function (id) { return this.getGravatarUrl(id, 100); }, /** diff --git a/modules/UI/videolayout/LargeVideo.js b/modules/UI/videolayout/LargeVideo.js index cec5fc987..9a5aeb899 100644 --- a/modules/UI/videolayout/LargeVideo.js +++ b/modules/UI/videolayout/LargeVideo.js @@ -8,7 +8,7 @@ import BottomToolbar from '../toolbars/BottomToolbar'; const RTCBrowserType = require("../../RTC/RTCBrowserType"); -const avatarSize = interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE; +const avatarSize = interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE; function getStreamId(stream) { if(!stream) @@ -163,7 +163,7 @@ class VideoContainer extends LargeContainer { this.stream = null; this.videoType = null; - this.$avatar = $('#activeSpeaker'); + this.$avatar = $('#domiantSpeaker'); this.$wrapper = $('#largeVideoWrapper'); if (!RTCBrowserType.isIExplorer()) { @@ -387,10 +387,10 @@ export default class LargeVideoManager { } /** - * Updates the src of the active speaker avatar + * Updates the src of the dominant speaker avatar */ updateAvatar (thumbUrl) { - $("#activeSpeakerAvatar").attr('src', thumbUrl); + $("#dominantSpeakerAvatar").attr('src', thumbUrl); } showAvatar (show) {