source/js/le-player.js
/**
	 * Merge defaultOptions, presetOptions with attrOptions and user's options;
	 *
	 * And complement two objects: controls and excludeControls
	 *
	 * @access private
	 */
Merge defaultOptions, presetOptions with attrOptions and user's options;
And complement two objects: controls and excludeControls

@access private
Merge defaultOptions presetOptions with attrOptions and user ' s options ; And complement two objects : controls and excludeControls @access private
_initOptions() {
		const attrOptions = this._optionsFromElement();
		let presetOptions = {};
		if (this._userOptions.preset && Player.getPreset(this._userOptions.preset)) {
			presetOptions = Player.getPreset(this._userOptions.preset).options;
		}
		this.options = $.extend(true, {}, defaultOptions, presetOptions, attrOptions, this._userOptions);
		if(this.options.sources && !Array.isArray(this.options.sources)) {
			this.options.sources = [this.options.sources]
		}
		if(typeof this.options.src === 'string') {
			this.options.src = { url : this.options.src }
		}
		if(this.options.src == null && this.options.sources.length > 0) {
			this.options.src = this.options.sources[0]
		}
		this.options.controls = $.extend({}, defaultOptions.controls, presetOptions.controls, this._userOptions.controls);
		for (const name in this.options.excludeControls) {
			if (!this.options.excludeControls.hasOwnProperty(name)) return;
			const controlCollection = this.options.excludeControls[name];
			controlCollection.forEach((row, index) => {
				if (this.options.controls[name] && this.options.controls[name][index]) {
					this.options.controls[name][index] = excludeArray(this.options.controls[name][index], row);
				}
			})
		}
		if (this.options.preset && Player.getPreset(this.options.preset)) {
			Player.getPreset(this.options.preset).initOptions();
		}
	}
_initOptions ( ) { const attrOptions = this . _optionsFromElement ( ) ; let presetOptions = { } ; if ( this . _userOptions . preset && Player . getPreset ( this . _userOptions . preset ) ) { presetOptions = Player . getPreset ( this . _userOptions . preset ) . options ; } this . options = $ . extend ( true , { } , defaultOptions , presetOptions , attrOptions , this . _userOptions ) ; if ( this . options . sources && ! Array . isArray ( this . options . sources ) ) { this . options . sources = [ this . options . sources ] } if ( typeof this . options . src === 'string' ) { this . options . src = { url : this . options . src } } if ( this . options . src == null && this . options . sources . length > 0 ) { this . options . src = this . options . sources [ 0 ] } this . options . controls = $ . extend ( { } , defaultOptions . controls , presetOptions . controls , this . _userOptions . controls ) ; for ( const name in this . options . excludeControls ) { if ( ! this . options . excludeControls . hasOwnProperty ( name ) ) return ; const controlCollection = this . options . excludeControls [ name ] ; controlCollection . forEach ( ( row , index ) => { if ( this . options . controls [ name ] && this . options . controls [ name ] [ index ] ) { this . options . controls [ name ] [ index ] = excludeArray ( this . options . controls [ name ] [ index ] , row ) ; } } ) } if ( this . options . preset && Player . getPreset ( this . options . preset ) ) { Player . getPreset ( this . options . preset ) . initOptions ( ) ; } }
Merge defaultOptions, presetOptions with attrOptions and user's options;
 And complement two objects: controls and excludeControls
Merge defaultOptions presetOptions with attrOptions and user ' s options ; And complement two objects : controls and excludeControls
// Merge default options + preset options + video attributts+ user options // Generate android:fullscreen, android:common and etc controls options // Merge correctly controls, without deep merge // exclude controls option // TODO(adinvadim): // Set depreceted flag for this option;