Added errorcodes for errorHandler. Removes big problems with unwanted skipping of video when ID's not loaded yet

This commit is contained in:
Kasper Rynning-Tønnesen
2015-04-29 19:35:00 +02:00
parent 3277569863
commit db0baa1c46

View File

@@ -223,7 +223,7 @@ function getTitle(titt, v)
function errorHandler(newState) function errorHandler(newState)
{ {
var failsafe = ytplayer.getVideoUrl().split("https://www.youtube.com/watch"); var failsafe = ytplayer.getVideoUrl().split("https://www.youtube.com/watch");
if(video_id !== undefined && !failsafe[0] == "" && !failsafe[1] == "") if(newState.data == 5 || newState.data == 100 || newState.data == 101 || newState.data == 150)
{ {
console.log(video_id); console.log(video_id);
console.log(ytplayer.getVideoUrl()); console.log(ytplayer.getVideoUrl());