mirror of
https://github.com/videojs/video.js.git
synced 2024-12-23 02:04:34 +02:00
Updatd to latest version
This commit is contained in:
parent
45e611e45d
commit
8993a05793
@ -25,8 +25,14 @@
|
|||||||
VideoJS.setup();
|
VideoJS.setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.addEventListener("keydown", function(e){
|
||||||
|
// alert(e.keyCode);
|
||||||
|
}, false);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Include the VideoJS Stylesheet -->
|
<!-- Include the VideoJS Stylesheet -->
|
||||||
<link rel="stylesheet" href="video-js.css" type="text/css" media="screen" title="Video JS" charset="utf-8">
|
<link rel="stylesheet" href="video-js.css" type="text/css" media="screen" title="Video JS" charset="utf-8">
|
||||||
</head>
|
</head>
|
||||||
|
@ -105,6 +105,15 @@ var VideoJS = Class.extend({
|
|||||||
// For some reason the same isn't needed for mouseover
|
// For some reason the same isn't needed for mouseover
|
||||||
this.controls.addEventListener("mouseout", this.onVideoMouseOut.context(this), false);
|
this.controls.addEventListener("mouseout", this.onVideoMouseOut.context(this), false);
|
||||||
|
|
||||||
|
// Create listener for esc key while in full screen mode
|
||||||
|
// Creating it during initialization to add context
|
||||||
|
// and because it has to be removed with removeEventListener
|
||||||
|
this.escKeyListener = function(event){
|
||||||
|
if (event.keyCode == 27) {
|
||||||
|
this.fullscreenOff();
|
||||||
|
}
|
||||||
|
}.context(this);
|
||||||
|
|
||||||
// Support older browsers that used autobuffer
|
// Support older browsers that used autobuffer
|
||||||
if (this.video.preload) this.video.autobuffer = true;
|
if (this.video.preload) this.video.autobuffer = true;
|
||||||
},
|
},
|
||||||
@ -490,6 +499,9 @@ var VideoJS = Class.extend({
|
|||||||
// Storing original doc overflow value to return to when fullscreen is off
|
// Storing original doc overflow value to return to when fullscreen is off
|
||||||
this.docOrigOverflow = document.documentElement.style.overflow;
|
this.docOrigOverflow = document.documentElement.style.overflow;
|
||||||
|
|
||||||
|
// Add listener for esc key to exit fullscreen
|
||||||
|
document.addEventListener("keydown", this.escKeyListener, false);
|
||||||
|
|
||||||
// Hide any scroll bars
|
// Hide any scroll bars
|
||||||
document.documentElement.style.overflow = 'hidden';
|
document.documentElement.style.overflow = 'hidden';
|
||||||
|
|
||||||
@ -505,6 +517,8 @@ var VideoJS = Class.extend({
|
|||||||
fullscreenOff: function(){
|
fullscreenOff: function(){
|
||||||
this.videoIsFullScreen = false;
|
this.videoIsFullScreen = false;
|
||||||
|
|
||||||
|
document.removeEventListener("keydown", this.escKeyListener, false);
|
||||||
|
|
||||||
// Unhide scroll bars.
|
// Unhide scroll bars.
|
||||||
document.documentElement.style.overflow = this.docOrigOverflow;
|
document.documentElement.style.overflow = this.docOrigOverflow;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user