Handle on player error so we can remove the player.
This commit is contained in:
parent
104503ee13
commit
ebe37ff98a
|
@ -162,6 +162,8 @@ export default class SharedVideoManager {
|
||||||
|
|
||||||
window.onPlayerError = function(event) {
|
window.onPlayerError = function(event) {
|
||||||
console.error("Error in the player:", event.data);
|
console.error("Error in the player:", event.data);
|
||||||
|
// store the error player, so we can remove it
|
||||||
|
self.errorInPlayer = event.target;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,8 +295,12 @@ export default class SharedVideoManager {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!this.player){
|
if(!this.player){
|
||||||
this.initialAttributes = attributes;
|
// if there is no error in the player till now,
|
||||||
return;
|
// store the initial attributes
|
||||||
|
if (!this.errorInPlayer) {
|
||||||
|
this.initialAttributes = attributes;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.intervalId) {
|
if(this.intervalId) {
|
||||||
|
@ -309,12 +315,19 @@ export default class SharedVideoManager {
|
||||||
VideoLayout.removeLargeVideoContainer(
|
VideoLayout.removeLargeVideoContainer(
|
||||||
SHARED_VIDEO_CONTAINER_TYPE);
|
SHARED_VIDEO_CONTAINER_TYPE);
|
||||||
|
|
||||||
this.player.destroy();
|
if(this.player) {
|
||||||
this.player = null;
|
this.player.destroy();
|
||||||
|
this.player = null;
|
||||||
|
}//
|
||||||
|
else if (this.errorInPlayer) {
|
||||||
|
this.errorInPlayer.destroy();
|
||||||
|
this.errorInPlayer = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.url = null;
|
this.url = null;
|
||||||
this.isSharedVideoShown = false;
|
this.isSharedVideoShown = false;
|
||||||
|
this.initialAttributes = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue