瀏覽代碼

fix: getPlayerState is not a function error in station

Kristian Vos 1 年之前
父節點
當前提交
74d580050c
共有 1 個文件被更改,包括 3 次插入2 次删除
  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";