1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-05 00:58:52 +02:00

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

Squashed commit of the following:

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

    Feature detect old fullscreen instead of UA switch

commit f3eccbbe67
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 0498b10084
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 cc45177ee5.

    Conflicts:
    	src/js/media/html5.js

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

    Use one for event binding.

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

    Update exports for request & cancel fullscreen

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

    On iOS, use ios specific enterFullscreen methods.

commit fe4a8fbf6a
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) ## 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, 'remainingTime', vjs.Player.prototype.remainingTime);
goog.exportProperty(vjs.Player.prototype, 'supportsFullScreen', vjs.Player.prototype.supportsFullScreen); 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, 'currentType', vjs.Player.prototype.currentType);
goog.exportProperty(vjs.Player.prototype, 'requestFullScreen', vjs.Player.prototype.currentType); goog.exportProperty(vjs.Player.prototype, 'requestFullScreen', vjs.Player.prototype.requestFullScreen);
goog.exportProperty(vjs.Player.prototype, 'cancelFullScreen', vjs.Player.prototype.currentType); goog.exportProperty(vjs.Player.prototype, 'requestFullscreen', vjs.Player.prototype.requestFullscreen);
goog.exportProperty(vjs.Player.prototype, 'isFullScreen', vjs.Player.prototype.currentType); 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.MediaLoader', vjs.MediaLoader);
goog.exportSymbol('videojs.TextTrackDisplay', vjs.TextTrackDisplay); goog.exportSymbol('videojs.TextTrackDisplay', vjs.TextTrackDisplay);

View File

@ -209,6 +209,20 @@ vjs.Html5.prototype.supportsFullScreen = function(){
vjs.Html5.prototype.enterFullScreen = function(){ vjs.Html5.prototype.enterFullScreen = function(){
var video = this.el_; 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) { if (video.paused && video.networkState <= video.HAVE_METADATA) {
// attempt to prime the video element for programmatic access // attempt to prime the video element for programmatic access
// this isn't necessary on the desktop but shouldn't hurt // this isn't necessary on the desktop but shouldn't hurt