v1.1.0-beta/version update, play err catch
This commit is contained in:
@@ -97,6 +97,9 @@ export default class Chat extends Component {
|
||||
// DONE WITH MOUNTING TASKS
|
||||
this.props.updateLoading(false);
|
||||
}
|
||||
componentWillUnmount() {
|
||||
this.mVideoListener.end();
|
||||
}
|
||||
videoEventListener(video) {
|
||||
this.syncPlayer(video);
|
||||
}
|
||||
|
||||
+13
-2
@@ -62,7 +62,10 @@ export default class VideoListener {
|
||||
window.postMessage({ type: 'SEEK', time: serverPlayer.time * 1000 }, '*');
|
||||
break;
|
||||
case PLAYER_SOURCE.AMAZON:
|
||||
if (this.video.status === PLAYER_STATUS.PAUSED) await this.video.element.play();
|
||||
if (this.video.status === PLAYER_STATUS.PAUSED)
|
||||
await this.video.element
|
||||
.play()
|
||||
.catch((err) => console.error('WatchParty erred when syncing time.'));
|
||||
this.video.element.currentTime = serverPlayer.time;
|
||||
await this.timeout(500);
|
||||
break;
|
||||
@@ -80,7 +83,9 @@ export default class VideoListener {
|
||||
await this.video.element.pause();
|
||||
break;
|
||||
case PLAYER_STATUS.PLAYING:
|
||||
await this.video.element.play();
|
||||
await this.video.element
|
||||
.play()
|
||||
.catch((err) => console.error('WatchParty erred when syncing play.'));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -246,4 +251,10 @@ export default class VideoListener {
|
||||
break;
|
||||
}
|
||||
}
|
||||
end() {
|
||||
if (this.video.element) {
|
||||
this.video.element.removeEventListener('playing', this.onplay);
|
||||
this.video.element.removeEventListener('pause', this.onpause);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user