Browse Source

fix: getPlayerState is not a function error in station

Kristian Vos 1 year ago
parent
commit
74d580050c
1 changed files with 3 additions and 2 deletions
  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";