mirror of
https://github.com/videojs/video.js.git
synced 2025-02-08 12:05:47 +02:00
Adds (removes) 'vjs-fullscreen' class on fullscreenchange event fixes #315
This commit is contained in:
parent
042b81e566
commit
ba110169f5
@ -323,8 +323,6 @@ so you can upgrade to newer versions easier. You can remove all these styles by
|
||||
.vjs-default-skin .vjs-fullscreen-control { width: 3.8em; cursor: pointer !important; float: right; }
|
||||
.vjs-default-skin .vjs-fullscreen-control div { width: 16px; height: 16px; background: url('video-js.png') -50px 0; margin: 0.5em auto 0; }
|
||||
|
||||
:-moz-full-screen .vjs-fullscreen-control div {background: url('video-js.png') -75px 0;}
|
||||
:-webkit-full-screen .vjs-fullscreen-control div {background: url('video-js.png') -75px 0;}
|
||||
.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control div { background: url('video-js.png') -75px 0; }
|
||||
|
||||
|
||||
|
@ -52,6 +52,7 @@ vjs.Player = function(tag, options, ready){
|
||||
this.on('progress', this.onProgress);
|
||||
this.on('durationchange', this.onDurationChange);
|
||||
this.on('error', this.onError);
|
||||
this.on('fullscreenchange', this.onFullscreenChange);
|
||||
|
||||
// Make player easily findable by ID
|
||||
vjs.players[this.id_] = this;
|
||||
@ -378,6 +379,14 @@ vjs.Player.prototype.onError = function(e) {
|
||||
vjs.log('Video Error', e);
|
||||
};
|
||||
|
||||
vjs.Player.prototype.onFullscreenChange = function(e) {
|
||||
if (this.isFullScreen) {
|
||||
this.addClass('vjs-fullscreen');
|
||||
} else {
|
||||
this.removeClass('vjs-fullscreen');
|
||||
}
|
||||
};
|
||||
|
||||
// /* Player API
|
||||
// ================================================================================ */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user