Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Handle on player error so we can remove the player.

damenchoebe37ff98a1e
diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.js
index addf0a2387..26996e3974 100644
--- a/modules/UI/shared_video/SharedVideo.js
+++ b/modules/UI/shared_video/SharedVideo.js
@@ -162,6 +162,8 @@ export default class SharedVideoManager {
window.onPlayerError = function(event) {
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;
if(!this.player){
- this.initialAttributes = attributes;
- return;
+ // if there is no error in the player till now,
+ // store the initial attributes
+ if (!this.errorInPlayer) {
+ this.initialAttributes = attributes;
+ return;
+ }
}
if(this.intervalId) {
@@ -309,12 +315,19 @@ export default class SharedVideoManager {
VideoLayout.removeLargeVideoContainer(
SHARED_VIDEO_CONTAINER_TYPE);
- this.player.destroy();
- this.player = null;
+ if(this.player) {
+ this.player.destroy();
+ this.player = null;
+ }//
+ else if (this.errorInPlayer) {
+ this.errorInPlayer.destroy();
+ this.errorInPlayer = null;
+ }
});
this.url = null;
this.isSharedVideoShown = false;
+ this.initialAttributes = null;
}
}