Skip to content

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

Removes playerPaused variable and just use player to get its state.

damencho2442f0dfd307
diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.js
index ab1f06b317..f522d29a36 100644
--- a/modules/UI/shared_video/SharedVideo.js
+++ b/modules/UI/shared_video/SharedVideo.js
@@ -155,7 +155,6 @@ export default class SharedVideoManager {
window.onPlayerStateChange = function(event) {
if (event.data == YT.PlayerState.PLAYING) {
- self.playerPaused = false;
self.player = event.target;
@@ -164,14 +163,13 @@ export default class SharedVideoManager {
self.processAttributes(
self.player,
self.initialAttributes,
- self.playerPaused);
+ false);
self.initialAttributes = null;
}
self.smartMute();
self.updateCheck();
} else if (event.data == YT.PlayerState.PAUSED) {
- self.playerPaused = true;
self.smartUnmute();
self.updateCheck(true);
}
@@ -372,7 +370,8 @@ export default class SharedVideoManager {
if(!this.player)
this.initialAttributes = attributes;
else {
- this.processAttributes(this.player, attributes, this.playerPaused);
+ this.processAttributes(this.player, attributes,
+ (this.player.getPlayerState() === YT.PlayerState.PAUSED));
}
}
@@ -446,7 +445,7 @@ export default class SharedVideoManager {
if (muted) {
this.mutedWithUserInteraction = userInteraction;
}
- else if (!this.playerPaused) {
+ else if (this.player.getPlayerState() !== YT.PlayerState.PAUSED) {
this.mutePlayer(true);
}
}