1
0
mirror of https://github.com/videojs/video.js.git synced 2025-03-29 22:07:10 +02:00

@gkatsev fixed isFullscreen reporting on iOS devices. closes #1511

Squashed commit of the following:

commit 02fe7a40d0958e2ed84a6a0cf2be43bec259c72c
Author: Gary Katsevman <git@gkatsev.com>
Date:   Tue Sep 23 14:15:08 2014 -0400

    Feature detect old fullscreen instead of UA switch

commit f3eccbbe678c163021d790c69c3ab365e0a1fe1a
Author: Gary Katsevman <git@gkatsev.com>
Date:   Mon Sep 22 21:31:34 2014 -0400

    No need for if since assume we're in fs

commit 0498b100843e0aa858b166d02a467e4471c126ab
Author: Gary Katsevman <git@gkatsev.com>
Date:   Mon Sep 22 21:28:10 2014 -0400

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

    This reverts commit cc45177ee5fa950e665e066d170b137aaeb6e398.

    Conflicts:
    	src/js/media/html5.js

commit 1ed30853efb2ea043da4f18b4fdf75da15f55e88
Author: Gary Katsevman <git@gkatsev.com>
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 27e27075083d2ad408b5d47055881b2554f59154
Author: Gary Katsevman <git@gkatsev.com>
Date:   Tue Sep 16 18:12:36 2014 -0400

    Use one for event binding.

commit cc45177ee5fa950e665e066d170b137aaeb6e398
Author: Gary Katsevman <git@gkatsev.com>
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 ad505a680785d638289657aec4edad60879e945a
Author: Gary Katsevman <git@gkatsev.com>
Date:   Mon Sep 15 16:45:48 2014 -0400

    Update exports for request & cancel fullscreen

commit e423635b6c8ad58a1ba04e1534a51c075e08b73a
Author: Gary Katsevman <git@gkatsev.com>
Date:   Mon Sep 15 16:15:10 2014 -0400

    On iOS, use ios specific enterFullscreen methods.

commit fe4a8fbf6ad73b6bc8f57d16c44f0ca4d3bf9450
Author: Gary Katsevman <git@gkatsev.com>
Date:   Mon Sep 15 14:53:20 2014 -0400

    Export isFullScreen correctly. Export isFullscreen as well.
This commit is contained in:
Gary Katsevman 2014-09-23 15:15:45 -07:00 committed by Steve Heffernan
parent 72cb71c3a5
commit d43831d6d0
3 changed files with 21 additions and 4 deletions

View File

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

View File

@ -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);

View File

@ -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