Skip to content

Commit

Permalink
On iOS, use ios specific enterFullscreen methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Sep 16, 2014
1 parent fe4a8fb commit e423635
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/js/media/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,21 @@ vjs.Html5.prototype.supportsFullScreen = function(){

vjs.Html5.prototype.enterFullScreen = function(){
var video = this.el_;

if (vjs.IS_IOS) {
vjs.on(video, 'webkitbeginfullscreen', vjs.bind(this, function(e) {
this.player_.isFullscreen(video['webkitDisplayingFullscreen']);
if (this.player_.isFullscreen()) {
vjs.on(video, 'webkitendfullscreen', vjs.bind(this, function(e) {
this.player_.isFullscreen(video['webkitDisplayingFullscreen']);
this.player_.trigger('fullscreenchange');
}));

this.player_.trigger('fullscreenchange');
}
}));
}

if (video.paused && video.networkState <= video.HAVE_METADATA) {
// attempt to prime the video element for programmatic access
// this isn't necessary on the desktop but shouldn't hurt
Expand Down

0 comments on commit e423635

Please sign in to comment.