Always uses current video type to search for container that will handle it. Renames video container type to camera, to match the type ot the tracks. Add the same container to be used and for tracks with type of desktop.

This commit is contained in:
damencho 2016-03-15 16:03:38 -05:00
parent ca56734d9c
commit 9e0b1beed5
2 changed files with 17 additions and 11 deletions

View File

@ -150,7 +150,7 @@ function getDesktopVideoPosition(videoWidth,
return { horizontalIndent, verticalIndent };
}
export const VideoContainerType = "video";
export const VideoContainerType = "camera";
/**
* Container for user video.
@ -357,6 +357,8 @@ export default class LargeVideoManager {
this.state = VideoContainerType;
this.videoContainer = new VideoContainer(() => this.resizeContainer(VideoContainerType));
this.addContainer(VideoContainerType, this.videoContainer);
// use the same video container to handle and desktop tracks
this.addContainer("desktop", this.videoContainer);
this.width = 0;
this.height = 0;
@ -413,7 +415,8 @@ export default class LargeVideoManager {
}
get id () {
return this.videoContainer.id;
let container = this.getContainer(this.state);
return container.id;
}
scheduleLargeVideoUpdate () {
@ -430,8 +433,9 @@ export default class LargeVideoManager {
this.newStreamData = null;
console.info("hover in %s", id);
this.state = VideoContainerType;
this.videoContainer.setStream(stream, videoType);
this.state = videoType;
let container = this.getContainer(this.state);
container.setStream(stream, videoType);
// change the avatar url on large
this.updateAvatar(Avatar.getAvatarUrl(id));
@ -439,7 +443,7 @@ export default class LargeVideoManager {
let isVideoMuted = stream ? stream.isMuted() : true;
// show the avatar on large if needed
this.videoContainer.showAvatar(isVideoMuted);
container.showAvatar(isVideoMuted);
let promise;
@ -449,7 +453,7 @@ export default class LargeVideoManager {
this.showWatermark(true);
promise = Promise.resolve();
} else {
promise = this.videoContainer.show();
promise = container.show();
}
// resolve updateLargeVideo promise after everything is done
@ -529,7 +533,8 @@ export default class LargeVideoManager {
* @param enable <tt>true</tt> to enable, <tt>false</tt> to disable
*/
enableVideoProblemFilter (enable) {
this.videoContainer.$video.toggleClass("videoProblemFilter", enable);
let container = this.getContainer(this.state);
container.$video.toggleClass("videoProblemFilter", enable);
}
/**

View File

@ -801,10 +801,11 @@ var VideoLayout = {
* @param forceUpdate indicates that hidden thumbnails will be shown
* @param completeFunction a function to be called when the video area is
* resized.
*/resizeVideoArea (isSideBarVisible,
forceUpdate = false,
animate = false,
completeFunction = null) {
*/
resizeVideoArea (isSideBarVisible,
forceUpdate = false,
animate = false,
completeFunction = null) {
if (largeVideo) {
largeVideo.updateContainerSize(isSideBarVisible);