mirror of
https://github.com/videojs/video.js.git
synced 2025-01-06 06:50:51 +02:00
Updated player options to use component options_ settings and mergeOptions.
This commit is contained in:
parent
fc97d6ece4
commit
9f566c0742
@ -61,11 +61,12 @@ vjs.CDN_VERSION = 'GENERATED_CDN_VSN';
|
|||||||
vjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://');
|
vjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global Player instance options
|
* Global Player instance options, surfaced from vjs.Player.prototype.options_
|
||||||
|
* vjs.options = vjs.Player.prototype.options_
|
||||||
|
* All options should use string keys so they avoid
|
||||||
|
* renaming by closure compiler
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
// var vjs = videojs;
|
|
||||||
|
|
||||||
vjs.options = {
|
vjs.options = {
|
||||||
// Default order of fallback technology
|
// Default order of fallback technology
|
||||||
'techOrder': ['html5','flash'],
|
'techOrder': ['html5','flash'],
|
||||||
|
@ -17,10 +17,7 @@ vjs.Player = function(tag, options, ready){
|
|||||||
// which overrides globally set options.
|
// which overrides globally set options.
|
||||||
// This latter part coincides with the load order
|
// This latter part coincides with the load order
|
||||||
// (tag must exist before Player)
|
// (tag must exist before Player)
|
||||||
var opts = {};
|
options = this.mergeOptions(this.getTagSettings(tag), options);
|
||||||
vjs.merge(opts, vjs.options); // Copy Global Defaults
|
|
||||||
vjs.merge(opts, this.getTagSettings(tag)); // Override with Video Tag Options
|
|
||||||
vjs.merge(opts, options); // Override/extend with options from setup call
|
|
||||||
|
|
||||||
// Cache for video property values.
|
// Cache for video property values.
|
||||||
this.cache_ = {};
|
this.cache_ = {};
|
||||||
@ -28,7 +25,7 @@ vjs.Player = function(tag, options, ready){
|
|||||||
// Run base component initializing with new options.
|
// Run base component initializing with new options.
|
||||||
// Builds the element through createEl()
|
// Builds the element through createEl()
|
||||||
// Inits and embeds any child components in opts
|
// Inits and embeds any child components in opts
|
||||||
vjs.Component.call(this, this, opts, ready);
|
vjs.Component.call(this, this, options, ready);
|
||||||
|
|
||||||
// Set poster
|
// Set poster
|
||||||
this.poster_ = this.options_['poster'];
|
this.poster_ = this.options_['poster'];
|
||||||
@ -61,6 +58,17 @@ vjs.Player = function(tag, options, ready){
|
|||||||
};
|
};
|
||||||
goog.inherits(vjs.Player, vjs.Component);
|
goog.inherits(vjs.Player, vjs.Component);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Player instance options, surfaced using vjs.options
|
||||||
|
* vjs.options = vjs.Player.prototype.options_
|
||||||
|
* Make changes in vjs.options, not here.
|
||||||
|
* All options should use string keys so they avoid
|
||||||
|
* renaming by closure compiler
|
||||||
|
* @type {Object}
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
vjs.Player.prototype.options_ = vjs.options;
|
||||||
|
|
||||||
vjs.Player.prototype.dispose = function(){
|
vjs.Player.prototype.dispose = function(){
|
||||||
// this.isReady_ = false;
|
// this.isReady_ = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user