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", "name": "Watch Party",
"short_name": "WP", "short_name": "WP",
"version": "1.0.2", "version": "1.1.0",
"description": "Watch streamed content together.", "description": "Watch streamed content together.",
"background": { "background": {
"page": "popup.html" "page": "popup.html"
+3
View File
@@ -97,6 +97,9 @@ export default class Chat extends Component {
// DONE WITH MOUNTING TASKS // DONE WITH MOUNTING TASKS
this.props.updateLoading(false); this.props.updateLoading(false);
} }
componentWillUnmount() {
this.mVideoListener.end();
}
videoEventListener(video) { videoEventListener(video) {
this.syncPlayer(video); this.syncPlayer(video);
} }
+13 -2
View File
@@ -62,7 +62,10 @@ export default class VideoListener {
window.postMessage({ type: 'SEEK', time: serverPlayer.time * 1000 }, '*'); window.postMessage({ type: 'SEEK', time: serverPlayer.time * 1000 }, '*');
break; break;
case PLAYER_SOURCE.AMAZON: 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; this.video.element.currentTime = serverPlayer.time;
await this.timeout(500); await this.timeout(500);
break; break;
@@ -80,7 +83,9 @@ export default class VideoListener {
await this.video.element.pause(); await this.video.element.pause();
break; break;
case PLAYER_STATUS.PLAYING: case PLAYER_STATUS.PLAYING:
await this.video.element.play(); await this.video.element
.play()
.catch((err) => console.error('WatchParty erred when syncing play.'));
break; break;
default: default:
break; break;
@@ -246,4 +251,10 @@ export default class VideoListener {
break; 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"> <section data-page="2">
<div class="page"> <div class="page">
<img src="./intro.gif" alt="Watch Party Intro" /> <img src="./intro.gif" alt="Watch Party Intro" />
<p>Watch your favorites on Netflix, Hulu & Amazon Prime with your favorite people</p> <p>
<mark>Disney+ And More Coming Soon.</mark> Watch your favorites on Netflix, Disney+, Amazon Prime, & Hulu (Beta) with your favorite
people
</p>
<mark>More Coming Soon.</mark>
</div> </div>
</section> </section>
<section data-page="3"> <section data-page="3">