1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-04 06:48:49 +02:00

Updated player options to use component options_ settings and mergeOptions.

This commit is contained in:
Steve Heffernan 2013-01-21 16:19:46 -08:00
parent fc97d6ece4
commit 9f566c0742
2 changed files with 17 additions and 8 deletions

View File

@ -61,11 +61,12 @@ vjs.CDN_VERSION = 'GENERATED_CDN_VSN';
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}
*/
// var vjs = videojs;
vjs.options = {
// Default order of fallback technology
'techOrder': ['html5','flash'],

View File

@ -17,10 +17,7 @@ vjs.Player = function(tag, options, ready){
// which overrides globally set options.
// This latter part coincides with the load order
// (tag must exist before Player)
var opts = {};
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
options = this.mergeOptions(this.getTagSettings(tag), options);
// Cache for video property values.
this.cache_ = {};
@ -28,7 +25,7 @@ vjs.Player = function(tag, options, ready){
// Run base component initializing with new options.
// Builds the element through createEl()
// Inits and embeds any child components in opts
vjs.Component.call(this, this, opts, ready);
vjs.Component.call(this, this, options, ready);
// Set poster
this.poster_ = this.options_['poster'];
@ -61,6 +58,17 @@ vjs.Player = function(tag, options, ready){
};
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(){
// this.isReady_ = false;