v1.1.0-beta/version update, play err catch

This commit is contained in:
Ayushya Amitabh
2020-05-11 12:25:52 -04:00
parent 0539af91c3
commit 2de32eccfd
4 changed files with 22 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "Watch Party",
"short_name": "WP",
"version": "1.0.2",
"version": "1.1.0",
"description": "Watch streamed content together.",
"background": {
"page": "popup.html"
+3
View File
@@ -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
View File
@@ -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);
}
}
}
+5 -2
View File
@@ -61,8 +61,11 @@
<section data-page="2">
<div class="page">
<img src="./intro.gif" alt="Watch Party Intro" />
<p>Watch your favorites on Netflix, Hulu & Amazon Prime with your favorite people</p>
<mark>Disney+ And More Coming Soon.</mark>
<p>
Watch your favorites on Netflix, Disney+, Amazon Prime, & Hulu (Beta) with your favorite
people
</p>
<mark>More Coming Soon.</mark>
</div>
</section>
<section data-page="3">