javascript - Detect “Done” on iPhone for YouTube/Vimeo videos (exit fullscreen) -
javascript - Detect “Done” on iPhone for YouTube/Vimeo videos (exit fullscreen) -
i embedded iframe video , want observe when user has exited (tapped “done”) fullscreen functionality on mobile safari takes place when tap “play”. tried code below:
html
<iframe id="video-iframe" src="//player.vimeo.com/video/105953491?title=0&byline=0&portrait=0&api=1" width="100%" height="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
javascript
document.getelementbyid("video-iframe").addeventlistener("webkitendfullscreen", function(){ alert("hello world!"); });
demo: http://jsfiddle.net/p3blohfk/
but it's not working (ios 8.0.2). ideas?
on ios 8, when scheme video player takes on uiwebview
on ios, main window of application hidden. hear uiwindowdidbecomehiddennotification
, uiwindowdidbecomevisiblenotification
notifications on view controller observe when user enters , exits total screen player:
[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(videodidexitfullscreen:) name:uiwindowdidbecomevisiblenotification object:self.view.window]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(videodidenterfullscreen:) name:uiwindowdidbecomehiddennotification object:self.view.window];
javascript ios youtube youtube-api youtube-iframe-api
Comments
Post a Comment