mirror of
https://github.com/videojs/video.js.git
synced 2025-07-03 00:57:02 +02:00
committed by
Steve Heffernan
parent
38f1024ad3
commit
a70b9e4957
@ -32,6 +32,11 @@ Once you have your WebVTT file created, you can add it to Video.js using the tra
|
|||||||
</video>
|
</video>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Subtitles from Another Domain
|
||||||
|
-----------------------------
|
||||||
|
Because we're pulling in the text track file via Javascript, the [same-origin policy](http://en.wikipedia.org/wiki/Same_origin_policy) applies. If you'd like to have a player served from one domain,
|
||||||
|
but the text track served from another, you'll need to [enable CORS](http://enable-cors.org/) in order to do so.
|
||||||
|
|
||||||
Track Attributes
|
Track Attributes
|
||||||
----------------
|
----------------
|
||||||
Additional settings for track tags.
|
Additional settings for track tags.
|
||||||
|
@ -1226,7 +1226,6 @@ vjs.Player.prototype.sourceList_ = function(sources){
|
|||||||
* Begin loading the src data.
|
* Begin loading the src data.
|
||||||
* @return {vjs.Player} Returns the player
|
* @return {vjs.Player} Returns the player
|
||||||
*/
|
*/
|
||||||
// http://dev.w3.org/html5/spec/video.html#dom-media-load
|
|
||||||
vjs.Player.prototype.load = function(){
|
vjs.Player.prototype.load = function(){
|
||||||
this.techCall('load');
|
this.techCall('load');
|
||||||
return this;
|
return this;
|
||||||
@ -1237,7 +1236,6 @@ vjs.Player.prototype.load = function(){
|
|||||||
* Can be used in conjuction with `currentType` to assist in rebuilding the current source object.
|
* Can be used in conjuction with `currentType` to assist in rebuilding the current source object.
|
||||||
* @return {String} The current source
|
* @return {String} The current source
|
||||||
*/
|
*/
|
||||||
// http://dev.w3.org/html5/spec/video.html#dom-media-currentsrc
|
|
||||||
vjs.Player.prototype.currentSrc = function(){
|
vjs.Player.prototype.currentSrc = function(){
|
||||||
return this.techGet('currentSrc') || this.cache_.src || '';
|
return this.techGet('currentSrc') || this.cache_.src || '';
|
||||||
};
|
};
|
||||||
@ -1252,7 +1250,11 @@ vjs.Player.prototype.currentType = function(){
|
|||||||
return this.currentType_ || '';
|
return this.currentType_ || '';
|
||||||
};
|
};
|
||||||
|
|
||||||
// Attributes/Options
|
/**
|
||||||
|
* Get or set the preload attribute.
|
||||||
|
* @return {String} The preload attribute value when getting
|
||||||
|
* @return {vjs.Player} Returns the player when setting
|
||||||
|
*/
|
||||||
vjs.Player.prototype.preload = function(value){
|
vjs.Player.prototype.preload = function(value){
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
this.techCall('setPreload', value);
|
this.techCall('setPreload', value);
|
||||||
@ -1261,6 +1263,12 @@ vjs.Player.prototype.preload = function(value){
|
|||||||
}
|
}
|
||||||
return this.techGet('preload');
|
return this.techGet('preload');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get or set the autoplay attribute.
|
||||||
|
* @return {String} The autoplay attribute value when getting
|
||||||
|
* @return {vjs.Player} Returns the player when setting
|
||||||
|
*/
|
||||||
vjs.Player.prototype.autoplay = function(value){
|
vjs.Player.prototype.autoplay = function(value){
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
this.techCall('setAutoplay', value);
|
this.techCall('setAutoplay', value);
|
||||||
@ -1269,6 +1277,12 @@ vjs.Player.prototype.autoplay = function(value){
|
|||||||
}
|
}
|
||||||
return this.techGet('autoplay', value);
|
return this.techGet('autoplay', value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get or set the loop attribute on the video element.
|
||||||
|
* @return {String} The loop attribute value when getting
|
||||||
|
* @return {vjs.Player} Returns the player when setting
|
||||||
|
*/
|
||||||
vjs.Player.prototype.loop = function(value){
|
vjs.Player.prototype.loop = function(value){
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
this.techCall('setLoop', value);
|
this.techCall('setLoop', value);
|
||||||
@ -1452,7 +1466,16 @@ vjs.Player.prototype.error = function(err){
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether or not the player is in the "ended" state.
|
||||||
|
* @return {Boolean} True if the player is in the ended state, false if not.
|
||||||
|
*/
|
||||||
vjs.Player.prototype.ended = function(){ return this.techGet('ended'); };
|
vjs.Player.prototype.ended = function(){ return this.techGet('ended'); };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether or not the player is in the "seeking" state.
|
||||||
|
* @return {Boolean} True if the player is in the seeking state, false if not.
|
||||||
|
*/
|
||||||
vjs.Player.prototype.seeking = function(){ return this.techGet('seeking'); };
|
vjs.Player.prototype.seeking = function(){ return this.techGet('seeking'); };
|
||||||
|
|
||||||
// When the player is first initialized, trigger activity so components
|
// When the player is first initialized, trigger activity so components
|
||||||
@ -1589,6 +1612,12 @@ vjs.Player.prototype.listenForUserActivity = function(){
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or sets the current playback rate.
|
||||||
|
* @param {Boolean} rate New playback rate to set.
|
||||||
|
* @return {Number} Returns the new playback rate when setting
|
||||||
|
* @return {Number} Returns the current playback rate when getting
|
||||||
|
*/
|
||||||
vjs.Player.prototype.playbackRate = function(rate) {
|
vjs.Player.prototype.playbackRate = function(rate) {
|
||||||
if (rate !== undefined) {
|
if (rate !== undefined) {
|
||||||
this.techCall('setPlaybackRate', rate);
|
this.techCall('setPlaybackRate', rate);
|
||||||
@ -1603,7 +1632,21 @@ vjs.Player.prototype.playbackRate = function(rate) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store the current audio state
|
||||||
|
* @type {Boolean}
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
vjs.Player.prototype.isAudio_ = false;
|
vjs.Player.prototype.isAudio_ = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or sets the audio flag
|
||||||
|
*
|
||||||
|
* @param {Boolean} bool True signals that this is an audio player.
|
||||||
|
* @return {Boolean} Returns true if player is audio, false if not when getting
|
||||||
|
* @return {vjs.Player} Returns the player if setting
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
vjs.Player.prototype.isAudio = function(bool) {
|
vjs.Player.prototype.isAudio = function(bool) {
|
||||||
if (bool !== undefined) {
|
if (bool !== undefined) {
|
||||||
this.isAudio_ = !!bool;
|
this.isAudio_ = !!bool;
|
||||||
|
Reference in New Issue
Block a user