push listener fix
This commit is contained in:
+20
-2
@@ -29,12 +29,30 @@ export default class VideoListener {
|
|||||||
Show Name: ${this.video.showName}\n
|
Show Name: ${this.video.showName}\n
|
||||||
Updating: ${this.isUpdating}
|
Updating: ${this.isUpdating}
|
||||||
`);
|
`);
|
||||||
if (this.server.status !== this.video.status) {
|
if (
|
||||||
if (this.video.showName && !this.isUpdating) this.listener(this.video);
|
this.server.status !== this.video.status ||
|
||||||
|
Math.abs(this.server.time - this.video.element.currentTime) > 2
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
this.video.showName &&
|
||||||
|
!this.isUpdating &&
|
||||||
|
(Math.abs(this.server.time - this.video.element.currentTime) > 2 ||
|
||||||
|
this.server.status !== this.video.status)
|
||||||
|
) {
|
||||||
|
this.listener(this.video);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doUpdate(serverPlayer) {
|
doUpdate(serverPlayer) {
|
||||||
this.server = serverPlayer;
|
this.server = serverPlayer;
|
||||||
|
|
||||||
|
console.log(`
|
||||||
|
Server Status: ${this.server.status}\n
|
||||||
|
Video Status: ${this.video.status}\n
|
||||||
|
Show Name: ${this.video.showName}\n
|
||||||
|
Updating: ${this.isUpdating}
|
||||||
|
`);
|
||||||
|
|
||||||
if (!this.isUpdating) {
|
if (!this.isUpdating) {
|
||||||
this.isUpdating = true;
|
this.isUpdating = true;
|
||||||
if (serverPlayer.updatedBy === window.localStorage.getItem('watchPartyUserUid')) {
|
if (serverPlayer.updatedBy === window.localStorage.getItem('watchPartyUserUid')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user