Fixes issues for audio only participants
This commit is contained in:
parent
4e66aefa26
commit
1176390214
|
@ -225,7 +225,9 @@ export default {
|
|||
|
||||
return JitsiMeetJS.init(config).then(() => {
|
||||
return Promise.all([
|
||||
this.createLocalTracks('audio', 'video').catch(
|
||||
this.createLocalTracks('audio', 'video').catch(()=>{
|
||||
return this.createLocalTracks('audio');
|
||||
}).catch(
|
||||
() => {return [];}),
|
||||
connect()
|
||||
]);
|
||||
|
@ -500,7 +502,7 @@ export default {
|
|||
handler(id , mute);
|
||||
});
|
||||
room.on(ConferenceEvents.TRACK_AUDIO_LEVEL_CHANGED, (id, lvl) => {
|
||||
if(this.isLocalId(id) && localAudio.isMuted()) {
|
||||
if(this.isLocalId(id) && localAudio && localAudio.isMuted()) {
|
||||
lvl = 0;
|
||||
}
|
||||
|
||||
|
@ -584,9 +586,13 @@ export default {
|
|||
});
|
||||
|
||||
APP.UI.addListener(UIEvents.AUDIO_MUTED, (muted) => {
|
||||
if(!localAudio)
|
||||
return;
|
||||
(muted)? localAudio.mute() : localAudio.unmute();
|
||||
});
|
||||
APP.UI.addListener(UIEvents.VIDEO_MUTED, (muted) => {
|
||||
if(!localVideo)
|
||||
return;
|
||||
(muted)? localVideo.mute() : localVideo.unmute();
|
||||
});
|
||||
|
||||
|
@ -794,7 +800,7 @@ export default {
|
|||
APP.desktopsharing.addListener(DSEvents.NEW_STREAM_CREATED,
|
||||
(track, callback) => {
|
||||
const localCallback = (newTrack) => {
|
||||
if(!newTrack || !newTrack.isLocal() ||
|
||||
if(!newTrack || !localVideo || !newTrack.isLocal() ||
|
||||
newTrack !== localVideo)
|
||||
return;
|
||||
if(localVideo.isMuted() &&
|
||||
|
@ -808,6 +814,7 @@ export default {
|
|||
if(room) {
|
||||
room.on(ConferenceEvents.TRACK_ADDED, localCallback);
|
||||
}
|
||||
if(localVideo)
|
||||
localVideo.stop();
|
||||
localVideo = track;
|
||||
addTrack(track);
|
||||
|
|
|
@ -277,6 +277,9 @@ class VideoContainer extends LargeContainer {
|
|||
this.stream = stream;
|
||||
this.videoType = videoType;
|
||||
|
||||
if(!stream)
|
||||
return;
|
||||
|
||||
stream.attach(this.$video);
|
||||
|
||||
let flipX = stream.isLocal() && !this.isScreenSharing();
|
||||
|
@ -421,7 +424,7 @@ export default class LargeVideoManager {
|
|||
// change the avatar url on large
|
||||
this.updateAvatar(Avatar.getAvatarUrl(id));
|
||||
|
||||
let isVideoMuted = stream.isMuted();
|
||||
let isVideoMuted = stream? stream.isMuted() : true;
|
||||
|
||||
// show the avatar on large if needed
|
||||
this.videoContainer.showAvatar(isVideoMuted);
|
||||
|
@ -443,19 +446,18 @@ export default class LargeVideoManager {
|
|||
/**
|
||||
* Update large video.
|
||||
* Switches to large video even if previously other container was visible.
|
||||
* @param userID the userID of the participant associated with the stream
|
||||
* @param {JitsiTrack?} stream new stream
|
||||
* @param {string?} videoType new video type
|
||||
* @returns {Promise}
|
||||
*/
|
||||
updateLargeVideo (stream, videoType) {
|
||||
let id = getStreamOwnerId(stream);
|
||||
|
||||
updateLargeVideo (userID, stream, videoType) {
|
||||
if (this.newStreamData) {
|
||||
this.newStreamData.reject();
|
||||
}
|
||||
|
||||
this.newStreamData = createDeferred();
|
||||
this.newStreamData.id = id;
|
||||
this.newStreamData.id = userID;
|
||||
this.newStreamData.stream = stream;
|
||||
this.newStreamData.videoType = videoType;
|
||||
|
||||
|
|
|
@ -987,6 +987,7 @@ var VideoLayout = {
|
|||
|
||||
let videoType = this.getRemoteVideoType(id);
|
||||
largeVideo.updateLargeVideo(
|
||||
id,
|
||||
smallVideo.videoStream,
|
||||
videoType
|
||||
).then(function() {
|
||||
|
|
Loading…
Reference in New Issue