javascript - popcorn.js: on mobile browser youtube "play" button does not appear -
i've been using popcorn.js youtube videos while. starting recently, on mobile browser (in case on ipad 2) "play" button doesn't appear did in past. video start load, can see title, instead of prominent "play" button black screen miniscule white dot in center. after checking source code, seems video inside iframe's video wrapper picking css style gives video height of 1px.
if press barely visible dot video play , popcorn code execute fine. pretty deal-breaker. maybe youtube thing , not popcorn.js thing, i'm looking direction.
see simple jsfiddle, based on 1 of popcorn.js examples, example: http://jsfiddle.net/nzhpa/1/
the code:
var pop = popcorn.smart("#container", "http://youtu.be/vdvmstecak4"); pop.footnote({ start: 1, end: 5, text: "works youtube!", target: "footnote-div" }); pop.play();
it's autoplay breaks on ipad.
in
/popcorn-js/wrappers/youtube/popcorn.htmlyoutubevideoelement.js
in onplayerready
function (around line 108) tricks done autoseek & mute initial loading. player.playvideo();
in function breaks ipad because youtube api not allow autoplay on ipad. should start user interaction
if comment player.playvideo();
line works (for me).
i'm not sure if breaks other things yet. see if can file issue @ popcorn this.
Comments
Post a Comment