mirror of
https://github.com/videojs/video.js.git
synced 2024-12-25 02:42:10 +02:00
Fixed android check. Added contributor. Updated some docs.
This commit is contained in:
parent
6824c1f1d8
commit
992f2ec23c
@ -14,7 +14,7 @@ Originally based on [this tutorial](http://blog.steveheffernan.com/2010/04/how-t
|
||||
|
||||
Contributors (Github Username)
|
||||
------------------------------
|
||||
heff, dz0ny, sentientbit, tvdeyen, brandonarbini, gordonbrander, Shraymonks, albertogasparin, sandaru1, nicholasbs, majornista, Fredust85, @wonderboymusic, ellis-, emirpprime, eirikb
|
||||
heff, dz0ny, sentientbit, tvdeyen, brandonarbini, gordonbrander, Shraymonks, albertogasparin, sandaru1, nicholasbs, majornista, Fredust85, @wonderboymusic, ellis-, emirpprime, eirikb, mbrubeck
|
||||
|
||||
|
||||
Getting Started
|
||||
@ -140,7 +140,9 @@ Changelog
|
||||
- Feature: Added option to disable controls. controlsEnabled: false
|
||||
- Feature: Setup method now has a callback, so you can more easily work with the player after setup
|
||||
- Feature: Added listeners for enter/exit full screen/window.
|
||||
- Feature: Added a VideoJS.player(id) function for getting the player for a video ID
|
||||
- Changes: setupAllWhenReady is now just setupAll (backward compatible)
|
||||
- Fix: Check for Android browser now excludes firefox and opera
|
||||
|
||||
2.0.2 (2010-12-10)
|
||||
|
||||
|
@ -103,7 +103,7 @@
|
||||
</div>
|
||||
<!-- End VideoJS -->
|
||||
|
||||
<a href="#" onclick="document.getElementById('example_video_1').currentTime = 10; return false;">Click</a>
|
||||
<a onClick="(function(){document.getElementById('example_video_1').player.flowplayer.play(); return false;})()">Click</a>
|
||||
|
||||
<table id="attributes">
|
||||
</table>
|
||||
|
@ -14,9 +14,22 @@ VideoJS.flashPlayers.flowplayer = {
|
||||
clip: { autoPlay: false, scaling: "fit" },
|
||||
plugins: { controls: { autoHide: "always" } },
|
||||
autoPlay: this.options.autoPlay,
|
||||
onLoad: function() {}.context(this)
|
||||
onLoad: function() {}.context(this),
|
||||
plugins: {
|
||||
controls: null
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.flowplayer.play();
|
||||
|
||||
this.buildStylesCheckDiv(); // Used to check if style are loaded
|
||||
// this.buildAndActivatePoster();
|
||||
// this.buildBigPlayButton();
|
||||
this.buildAndActivateSpinner();
|
||||
this.buildAndActivateControlBar();
|
||||
this.loadInterface(); // Show everything once styles are loaded
|
||||
this.getSubtitles();
|
||||
},
|
||||
|
||||
api: {
|
||||
|
@ -13,8 +13,8 @@ VideoJS.fn.extend({
|
||||
this.element = this.flashElement;
|
||||
this.video.src = ""; // Stop video from downloading if HTML5 is still supported
|
||||
var flashPlayer = VideoJS.flashPlayers[this.options.flashPlayer];
|
||||
flashPlayer.init.call(this);
|
||||
this.api = flashPlayer.api;
|
||||
flashPlayer.init.call(this);
|
||||
this.api.setupTriggers.call(this);
|
||||
},
|
||||
|
||||
|
@ -17,7 +17,7 @@ var VideoJS = JRClass.extend({
|
||||
|
||||
this.video.player = this; // Store reference to player on the video element.
|
||||
this.box = this.video.parentNode; // Container element for controls positioning
|
||||
this.values = {}; // Cache video values.
|
||||
this.values = {}; // Cache for video property values.
|
||||
this.elements = {}; // Store refs to controls elements.
|
||||
this.listeners = {}; // Store video event listeners.
|
||||
this.api = {}; // Current API to video functions (changes with player type)
|
||||
@ -31,7 +31,7 @@ var VideoJS = JRClass.extend({
|
||||
autoplay: false,
|
||||
preload: true,
|
||||
loop: false,
|
||||
returnToStart: true,
|
||||
returnToStart: true, // Go back to the beginning when the video is done
|
||||
controlsEnabled: true,
|
||||
useBuiltInControls: false, // Use the browser's controls (iPhone)
|
||||
controlsBelow: false, // Display control bar below video vs. in front of
|
||||
|
@ -36,14 +36,15 @@ After the player has been setup, you can also always access the player through t
|
||||
|
||||
Now that you have access to the player through the myPlayer variable, you can control the video or react to video events using the following methods.
|
||||
|
||||
play()
|
||||
|
||||
### play()
|
||||
Start video playback.
|
||||
Returns the player object.
|
||||
Example:
|
||||
|
||||
myPlayer.play();
|
||||
|
||||
onPlay(callback) // Type: Function
|
||||
### onPlay(callback) // Type: Function
|
||||
Trigger the supplied callback function every time the video starts playing.
|
||||
Returns the player object.
|
||||
Example:
|
||||
@ -52,14 +53,14 @@ onPlay(callback) // Type: Function
|
||||
alert("OMG Video is playing!");
|
||||
});
|
||||
|
||||
pause()
|
||||
### pause()
|
||||
Pause the video playback.
|
||||
Returns: the player object
|
||||
Example:
|
||||
|
||||
myPlayer.pause();
|
||||
|
||||
onPause(callback) // Type: Function
|
||||
### onPause(callback) // Type: Function
|
||||
Trigger the supplied callback function every time the video is paused.
|
||||
Returns the player object.
|
||||
Example:
|
||||
@ -68,20 +69,20 @@ onPause(callback) // Type: Function
|
||||
alert("OMG Video is paused now!");
|
||||
});
|
||||
|
||||
currentTime()
|
||||
### currentTime()
|
||||
Returns the current time of the video in seconds.
|
||||
Example:
|
||||
|
||||
var whereYouAt = myPlayer.currentTime();
|
||||
|
||||
currentTime(seconds) // Type: Integer or Float
|
||||
### currentTime(seconds) // Type: Integer or Float
|
||||
Seek to the supplied time (seconds).
|
||||
Returns the player object.
|
||||
Example:
|
||||
|
||||
myPlayer.currentTime(120); // 2 minutes into the video
|
||||
|
||||
onTimeUpdate(callback) // Type: Function
|
||||
### onTimeUpdate(callback) // Type: Function
|
||||
Trigger the supplied callback function every time the currentTime changes. This is triggered about 10 times per second.
|
||||
Returns the player object.
|
||||
Example:
|
||||
@ -90,7 +91,7 @@ onTimeUpdate(callback) // Type: Function
|
||||
alert("The video is now " + myPlayer.currentTime() + " seconds in.");
|
||||
});
|
||||
|
||||
onEnded(callback) // Type: Function
|
||||
### onEnded(callback) // Type: Function
|
||||
Trigger the supplied callback function when the video finishes playing.
|
||||
Returns the player object.
|
||||
Example:
|
||||
@ -99,13 +100,13 @@ onEnded(callback) // Type: Function
|
||||
alert("Fin!");
|
||||
});
|
||||
|
||||
duration()
|
||||
### duration()
|
||||
Returns the length in time of the video in seconds. Note: The video must have started loading before the duration can be known.
|
||||
Example:
|
||||
|
||||
var howLongIsThis = myPlayer.duration();
|
||||
|
||||
onDurationUpdate(callback) // Type: Function
|
||||
### onDurationUpdate(callback) // Type: Function
|
||||
Trigger the supplied callback function when the video's duration is updated.
|
||||
Returns the player object.
|
||||
Example:
|
||||
@ -114,14 +115,14 @@ onDurationUpdate(callback) // Type: Function
|
||||
alert("The video's duration is now " + myPlayer.duration());
|
||||
});
|
||||
|
||||
buffered()
|
||||
### buffered()
|
||||
Returns the amount of video that has loaded (downloaded) into the buffer.
|
||||
Example:
|
||||
|
||||
// Needs to be expanded
|
||||
var howMuchIsLoaded = myPlayer.duration();
|
||||
|
||||
onBufferedUpdate(callback) // Type: Function
|
||||
### onBufferedUpdate(callback) // Type: Function
|
||||
Trigger the supplied callback function when the video's buffered amount is updated.
|
||||
Returns the player object.
|
||||
Example:
|
||||
@ -131,19 +132,19 @@ onBufferedUpdate(callback) // Type: Function
|
||||
alert("The video's duration is now " + myPlayer.duration());
|
||||
});
|
||||
|
||||
volume()
|
||||
### volume()
|
||||
Returns the current volume of the video as a percent in decimal form. 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
|
||||
Example:
|
||||
|
||||
var howLoudIsIt = myPlayer.volume();
|
||||
|
||||
volume(percentAsDecimal)
|
||||
### volume(percentAsDecimal)
|
||||
Set the volume to the supplied percent (as a decimal between 0 and 1).
|
||||
Example:
|
||||
|
||||
myPlayer.volume(0.5); // Set volume to half
|
||||
|
||||
onVolumeChange(callback)
|
||||
### onVolumeChange(callback)
|
||||
Trigger the supplied callback function when the video's volume changes.
|
||||
Returns the player object.
|
||||
Example:
|
||||
@ -152,38 +153,38 @@ onVolumeChange(callback)
|
||||
alert("The video's volume is now " + myPlayer.volume());
|
||||
});
|
||||
|
||||
width()
|
||||
### width()
|
||||
Returns the current width of the video in pixels.
|
||||
Example:
|
||||
|
||||
var howWideIsIt = myPlayer.width();
|
||||
|
||||
width(pixels)
|
||||
### width(pixels)
|
||||
Change the width of the video to the supplied width in pixels.
|
||||
Returns the player object
|
||||
Example:
|
||||
|
||||
myPlayer.width(640);
|
||||
|
||||
height()
|
||||
### height()
|
||||
Returns the current height of the video in pixels.
|
||||
Example:
|
||||
|
||||
var howTallIsIt = myPlayer.height();
|
||||
|
||||
height(pixels)
|
||||
### height(pixels)
|
||||
Change the height of the video to the supplied height in pixels.
|
||||
Returns the player object
|
||||
|
||||
myPlayer.height(480);
|
||||
|
||||
size(width, height)
|
||||
### size(width, height)
|
||||
Changes the width and height of the video to the supplied width and height. This is more efficient if you're changing both width and height.
|
||||
Returns the player object.
|
||||
|
||||
myPlayer.size(640,480);
|
||||
|
||||
onResize(callback)
|
||||
### onResize(callback)
|
||||
Trigger the supplied callback function when the video's size (width, height, or both) changes.
|
||||
Returns the player object.
|
||||
|
||||
@ -191,19 +192,19 @@ onResize(callback)
|
||||
alert("The video is now " + myPlayer.width() + " by " + myPlayer.height());
|
||||
});
|
||||
|
||||
enterFullScreen()
|
||||
### enterFullScreen()
|
||||
Increase the size of the video to full screen. In some browsers, full screen is not supported natively, so it enters full window mode, where the fills the browser window. In browsers that support native full screen, typically the browser's default controls will be shown, and not the VideoJS custom skin. In full window mode, the VideoJS controls and skin will always be used.
|
||||
Returns the player object.
|
||||
|
||||
myPlayer.enterFullScreen();
|
||||
|
||||
exitFullScreen()
|
||||
### exitFullScreen()
|
||||
Return the video to its normal size after having been in full screen mode.
|
||||
Returns the player object.
|
||||
|
||||
myPlayer.exitFullScreen();
|
||||
|
||||
onError(callback)
|
||||
### onError(callback)
|
||||
Trigger the supplied callback function when the video when there is an error with the video.
|
||||
Returns the player object.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user