From ecebcf0d32d8ca69bfd9f893f59bb5d1651dbe3d Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Mon, 10 Nov 2025 20:31:07 -0500 Subject: [PATCH] Killed harmless bug related to official YT Api that cluttered the console. --- www/js/channel/channel.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/www/js/channel/channel.js b/www/js/channel/channel.js index 5d50499..6da26c3 100644 --- a/www/js/channel/channel.js +++ b/www/js/channel/channel.js @@ -337,13 +337,16 @@ function onYouTubeIframeAPIReady(){ //Set embed api to true client.ytEmbedAPILoaded = true; - //Get currently playing item - const nowPlaying = client.player.mediaHandler.nowPlaying; + //If the player is ready and has a mediaHandler loaded + if(client.player != null && client.player.mediaHandler != null){ + //Get currently playing item + const nowPlaying = client.player.mediaHandler.nowPlaying; - //If we're playing a youtube video and the official embeds are enabled - if(nowPlaying.type == 'yt' && localStorage.getItem('ytPlayerType') == "embed"){ - //Restart the video now that the embed api has loaded - client.player.start({media: nowPlaying}); + //If we're playing a youtube video and the official embeds are enabled + if(nowPlaying.type == 'yt' && localStorage.getItem('ytPlayerType') == "embed"){ + //Restart the video now that the embed api has loaded + client.player.start({media: nowPlaying}); + } } }