diff --git a/popcorn.js b/popcorn.js index 7df8ea428..f95a0150e 100644 --- a/popcorn.js +++ b/popcorn.js @@ -846,7 +846,7 @@ Popcorn.Events = { UIEvents: "blur focus focusin focusout load resize scroll unload", MouseEvents: "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave click dblclick", - Events: "loadstart progress suspend emptied stalled play pause error " + + Events: "unstarted loadstart progress suspend emptied stalled play pause error " + "loadedmetadata loadeddata waiting playing canplay canplaythrough " + "seeking seeked timeupdate ended ratechange durationchange volumechange" }; diff --git a/wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js b/wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js index e560fe63b..3c2eeca47 100644 --- a/wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js +++ b/wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js @@ -47,6 +47,10 @@ ytCallbacks[ i ](); delete ytCallbacks[ i ]; } + + if(YT && YT.PlayerState && !YT.PlayerState.UNSTARTED) { + YT.PlayerState.UNSTARTED = -1; + } }; function HTMLYouTubeVideoElement( id ) { @@ -198,6 +202,10 @@ function onPlayerStateChange( event ) { switch( event.data ) { + case YT.PlayerState.UNSTARTED: + impl.src = player.getVideoUrl(); + + self.dispatchEvent("unstarted"); // ended case YT.PlayerState.ENDED: