LargeVideo: detach previous stream when attaching new one

This commit is contained in:
isymchych 2016-02-18 15:38:57 +02:00
parent 8b2244b47a
commit 6476503240
1 changed files with 7 additions and 1 deletions

View File

@ -270,11 +270,17 @@ class VideoContainer extends LargeContainer {
* @param {string} videoType video type
*/
setStream (stream, videoType) {
// detach old stream
if (this.stream) {
this.stream.detach(this.$video[0]);
}
this.stream = stream;
this.videoType = videoType;
if(!stream)
if (!stream) {
return;
}
stream.attach(this.$video[0]);