Skip to content

Commit

Permalink
Merge pull request #54 from alexthewilde/master
Browse files Browse the repository at this point in the history
Trigger 'canplay' event as soon as YT player has finished loading
  • Loading branch information
2fdevs committed Feb 18, 2016
2 parents c25002c + dc51c3d commit f10a0de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ angular.module("info.vietnamcode.nampnq.videogular.plugins.youtube", [])
}
updateTimer = setInterval(updateTime, 600);
angular.element(ytplayer.getIframe()).css({'width':'100%','height':'100%'});

// Trigger canplay event
var event = new CustomEvent("canplay");
API.mediaElement[0].dispatchEvent(event);
}

function onVideoStateChange(event) {
Expand Down

0 comments on commit f10a0de

Please sign in to comment.