Преглед на файлове

fix(Station): player.value.pauseVideo is not a function

Owen Diffey преди 2 години
родител
ревизия
8459ac0e24
променени са 1 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 10 1
      frontend/src/pages/Station/index.vue

+ 10 - 1
frontend/src/pages/Station/index.vue

@@ -362,7 +362,8 @@ const calculateTimeElapsed = () => {
 		(Date.currently() - startedAt.value - timePaused.value) / 1000;
 
 	const songDuration = currentSong.value.duration;
-	if (songDuration <= duration) player.value.pauseVideo();
+	if (playerReady.value && songDuration <= duration)
+		player.value.pauseVideo();
 	if (duration <= songDuration)
 		timeElapsed.value = utils.formatTime(duration);
 };
@@ -426,6 +427,14 @@ const youtubeReady = () => {
 
 					playVideo();
 
+					const duration =
+						(Date.currently() -
+							startedAt.value -
+							timePaused.value) /
+						1000;
+					const songDuration = currentSong.value.duration;
+					if (songDuration <= duration) player.value.pauseVideo();
+
 					// on ios, playback will be forcibly paused locally
 					if (isApple.value) {
 						updateLocalPaused(true);