Skip to content

Commit

Permalink
@gkatsev fixed isFullscreen reporting on iOS devices. closes #1511
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 02fe7a4
Author: Gary Katsevman <[email protected]>
Date:   Tue Sep 23 14:15:08 2014 -0400

    Feature detect old fullscreen instead of UA switch

commit f3eccbb
Author: Gary Katsevman <[email protected]>
Date:   Mon Sep 22 21:31:34 2014 -0400

    No need for if since assume we're in fs

commit 0498b10
Author: Gary Katsevman <[email protected]>
Date:   Mon Sep 22 21:28:10 2014 -0400

    Revert "Don't trigget vjs's fullscreenchange event"

    This reverts commit cc45177.

    Conflicts:
    	src/js/media/html5.js

commit 1ed3085
Author: Gary Katsevman <[email protected]>
Date:   Wed Sep 17 12:00:29 2014 -0400

    Listen via 'this.one'.
    Don't bother checking whether the video element is fullscreen but just
    assume we are fullscreen.

commit 27e2707
Author: Gary Katsevman <[email protected]>
Date:   Tue Sep 16 18:12:36 2014 -0400

    Use one for event binding.

commit cc45177
Author: Gary Katsevman <[email protected]>
Date:   Mon Sep 15 17:28:46 2014 -0400

    Don't trigget vjs's fullscreenchange event
    This event isn't really being used for this usecase right now, so, no
    need to trigger it.

commit ad505a6
Author: Gary Katsevman <[email protected]>
Date:   Mon Sep 15 16:45:48 2014 -0400

    Update exports for request & cancel fullscreen

commit e423635
Author: Gary Katsevman <[email protected]>
Date:   Mon Sep 15 16:15:10 2014 -0400

    On iOS, use ios specific enterFullscreen methods.

commit fe4a8fb
Author: Gary Katsevman <[email protected]>
Date:   Mon Sep 15 14:53:20 2014 -0400

    Export isFullScreen correctly. Export isFullscreen as well.
  • Loading branch information
gkatsev authored and heff committed Sep 23, 2014
1 parent 72cb71c commit d43831d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHANGELOG
=========

## HEAD (Unreleased)
_(none)_
* @gkatsev fixed isFullscreen reporting on iOS devices ([view](https://github.com/videojs/video.js/pull/1511))

--------------------

Expand Down
9 changes: 6 additions & 3 deletions src/js/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ goog.exportProperty(vjs.Player.prototype, 'preload', vjs.Player.prototype.preloa
goog.exportProperty(vjs.Player.prototype, 'remainingTime', vjs.Player.prototype.remainingTime);
goog.exportProperty(vjs.Player.prototype, 'supportsFullScreen', vjs.Player.prototype.supportsFullScreen);
goog.exportProperty(vjs.Player.prototype, 'currentType', vjs.Player.prototype.currentType);
goog.exportProperty(vjs.Player.prototype, 'requestFullScreen', vjs.Player.prototype.currentType);
goog.exportProperty(vjs.Player.prototype, 'cancelFullScreen', vjs.Player.prototype.currentType);
goog.exportProperty(vjs.Player.prototype, 'isFullScreen', vjs.Player.prototype.currentType);
goog.exportProperty(vjs.Player.prototype, 'requestFullScreen', vjs.Player.prototype.requestFullScreen);
goog.exportProperty(vjs.Player.prototype, 'requestFullscreen', vjs.Player.prototype.requestFullscreen);
goog.exportProperty(vjs.Player.prototype, 'cancelFullScreen', vjs.Player.prototype.cancelFullScreen);
goog.exportProperty(vjs.Player.prototype, 'exitFullscreen', vjs.Player.prototype.exitFullscreen);
goog.exportProperty(vjs.Player.prototype, 'isFullScreen', vjs.Player.prototype.isFullScreen);
goog.exportProperty(vjs.Player.prototype, 'isFullscreen', vjs.Player.prototype.isFullscreen);

goog.exportSymbol('videojs.MediaLoader', vjs.MediaLoader);
goog.exportSymbol('videojs.TextTrackDisplay', vjs.TextTrackDisplay);
Expand Down
14 changes: 14 additions & 0 deletions src/js/media/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,20 @@ vjs.Html5.prototype.supportsFullScreen = function(){

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

if ('webkitDisplayingFullscreen' in video) {
this.one('webkitbeginfullscreen', vjs.bind(this, function(e) {
this.player_.isFullscreen(true);

this.one('webkitendfullscreen', vjs.bind(this, function(e) {
this.player_.isFullscreen(false);
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 d43831d

Please sign in to comment.