Killed harmless bug related to official YT Api that cluttered the console.

This commit is contained in:
rainbow napkin 2025-11-10 20:31:07 -05:00
parent eaca9db987
commit ecebcf0d32

View file

@ -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});
}
}
}