mirror of
https://github.com/videojs/video.js.git
synced 2024-12-25 02:42:10 +02:00
Added option to disable controls.
This commit is contained in:
parent
069535932c
commit
d325f6aa56
@ -154,6 +154,7 @@ VideoJS.fn.newBehavior("controlBar", function(element){
|
|||||||
_V_.addListener(element, "mouseout", this.onControlBarsMouseOut.context(this));
|
_V_.addListener(element, "mouseout", this.onControlBarsMouseOut.context(this));
|
||||||
},{
|
},{
|
||||||
showControlBars: function(){
|
showControlBars: function(){
|
||||||
|
if (!this.options.controlsEnabled) { return; }
|
||||||
if (!this.options.controlsAtStart && !this.hasPlayed) { return; }
|
if (!this.options.controlsAtStart && !this.hasPlayed) { return; }
|
||||||
this.each(this.controlBars, function(bar){
|
this.each(this.controlBars, function(bar){
|
||||||
// bar.style.opacity = 1;
|
// bar.style.opacity = 1;
|
||||||
@ -438,6 +439,7 @@ VideoJS.fn.newBehavior("bigPlayButton", function(element){
|
|||||||
this.activateElement(element, "playButton");
|
this.activateElement(element, "playButton");
|
||||||
},{
|
},{
|
||||||
showBigPlayButtons: function(){
|
showBigPlayButtons: function(){
|
||||||
|
if (!this.options.controlsEnabled) { return; }
|
||||||
this.each(this.elements.bigPlayButtons, function(element){
|
this.each(this.elements.bigPlayButtons, function(element){
|
||||||
element.style.display = "block";
|
element.style.display = "block";
|
||||||
});
|
});
|
||||||
|
@ -32,6 +32,7 @@ var VideoJS = JRClass.extend({
|
|||||||
preload: true,
|
preload: true,
|
||||||
loop: false,
|
loop: false,
|
||||||
returnToStart: true,
|
returnToStart: true,
|
||||||
|
controlsEnabled: true,
|
||||||
useBuiltInControls: false, // Use the browser's controls (iPhone)
|
useBuiltInControls: false, // Use the browser's controls (iPhone)
|
||||||
controlsBelow: false, // Display control bar below video vs. in front of
|
controlsBelow: false, // Display control bar below video vs. in front of
|
||||||
controlsAtStart: false, // Make controls visible when page loads
|
controlsAtStart: false, // Make controls visible when page loads
|
||||||
@ -283,6 +284,7 @@ VideoJS.extend({
|
|||||||
var match = navigator.userAgent.match(/Android (\d+)\./i);
|
var match = navigator.userAgent.match(/Android (\d+)\./i);
|
||||||
if (match && match[1]) { return match[1]; }
|
if (match && match[1]) { return match[1]; }
|
||||||
},
|
},
|
||||||
|
//isAndroidBrowser
|
||||||
|
|
||||||
warnings: {
|
warnings: {
|
||||||
// Safari errors if you call functions on a video that hasn't loaded yet
|
// Safari errors if you call functions on a video that hasn't loaded yet
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<!-- <script src="flowplayer/video-js.flowplayer.js" type="text/javascript" charset="utf-8"></script> -->
|
<!-- <script src="flowplayer/video-js.flowplayer.js" type="text/javascript" charset="utf-8"></script> -->
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
VideoJS.setupAllWhenReady();
|
VideoJS.setupAllWhenReady({ controlsEnabled: false });
|
||||||
VideoJS.DOMReady(function(){
|
VideoJS.DOMReady(function(){
|
||||||
// myPlayer = VideoJS.setup("example_video_1", {
|
// myPlayer = VideoJS.setup("example_video_1", {
|
||||||
// // controlsHiding: true,
|
// // controlsHiding: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user