Explorar el Código

fix: getPlayerState is not a function error in station

Kristian Vos hace 1 año
padre
commit
74d580050c
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      frontend/src/pages/Station/index.vue

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

@@ -1094,8 +1094,9 @@ const sendActivityWatchMediaData = () => {
 		!noSong.value &&
 		(experimentalChangableListenMode.value === "participate" ||
 			currentSongMediaType.value !== "youtube" ||
-			youtubePlayer.value?.getPlayerState() ===
-				window.YT.PlayerState.PLAYING)
+			(typeof youtubePlayer.value?.getPlayerState === "function" &&
+				youtubePlayer.value?.getPlayerState() ===
+					window.YT.PlayerState.PLAYING))
 	) {
 		if (activityWatchMediaLastStatus.value !== "playing") {
 			activityWatchMediaLastStatus.value = "playing";