Browse Source

fix(mobile): should fix issue with forced pausing on ios not notifying our localPaused variable

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 years ago
parent
commit
fd879113e1
1 changed files with 3 additions and 8 deletions
  1. 3 8
      frontend/src/pages/Station/index.vue

+ 3 - 8
frontend/src/pages/Station/index.vue

@@ -1151,6 +1151,9 @@ export default {
 							if (this.muted) this.player.mute();
 
 							this.playVideo();
+
+							// on ios, playback will be forcibly paused locally
+							if (this.isIOS) this.localPaused = true;
 						},
 						onError: err => {
 							console.log("error with youtube video", err);
@@ -1197,14 +1200,6 @@ export default {
 							}
 						},
 						onStateChange: event => {
-							// on ios, playback will be paused locally by default
-							if (
-								event.data === window.YT.PlayerState.PAUSED &&
-								!this.localPaused &&
-								this.isIOS
-							)
-								this.localPaused = true;
-
 							if (
 								event.data === window.YT.PlayerState.PLAYING &&
 								this.videoLoading === true