<commit_before>/**
* Msg text is inherited from embedPlayer
*/

( function( mw, $ ) { "use strict";
/**
* mw.PlayerLayoutBuilder object
*	@param the embedPlayer element we are targeting
*/
mw.PlayerLayoutBuilder = function( embedPlayer, options ) {
	return this.init( embedPlayer, options );
};

/**
 * ControlsBuilder prototype:
 */
mw.PlayerLayoutBuilder.prototype = {
	//Default Local values:

	// Default control bar height
	height: mw.getConfig( 'EmbedPlayer.ControlsHeight' ),

	// Default supported components is merged with embedPlayer set of supported types
	supportedComponents: {},

	// Flag to store if a warning binding has been added
	addWarningFlag: false,

	// Flag to store state of overlay on player
	displayOptionsMenuFlag: false,

	// Flag to store controls status (disabled/enabled)
	controlsDisabled: false,
	
	// binding postfix
	bindPostfix: '.layoutBuilder',

	layoutReady: false,

	keepControlsOnScreen: false,

	playingFlag: false,
	// Display importance available values
	importanceSet: ['low', 'medium', 'high'],

	/**
	* Initialization Object for the control builder
	*
	* @param {Object} embedPlayer EmbedPlayer interface
	*/
	init: function( embedPlayer ) {
		var _this = this;
		this.embedPlayer = embedPlayer;
		this.fullScreenManager = new mw.FullScreenManager( embedPlayer );
		var animationSupported = this.checkAnimationSupport();
		mw.setConfig( 'EmbedPlayer.AnimationSupported', animationSupported );
		this.addUserAgentCssClass();
		$(document.body).append($('<div style="display: block" class="cssChecker"></div>'));
		this.checkViewPort();
		// Return the layoutBuilder Object:
		return this;
	},

	getInterface: function() {
		if( ! this.$interface ) {

			var embedPlayer = this.embedPlayer,
				$embedPlayer = $( embedPlayer );

			// build the videoDisplay wrapper if needed
			if( $embedPlayer.parent('.videoDisplay').length == 0 ){
				$embedPlayer.wrap(
					$('<div />').addClass( 'videoDisplay' )
				);
			}

			var $videoDisplay = $embedPlayer.parent('.videoDisplay');
			if( $videoDisplay.find('.videoShadow').length == 0 ){
				$(".mwEmbedPlayer").before('<div class="videoShadow"></div>');
			}
			// build the videoHolder wrapper if needed
			if( $videoDisplay.parent('.videoHolder').length == 0 ){
				$videoDisplay.parent('.videoDisplay').wrap(
					$('<div />').addClass( 'videoHolder')
				);
			}

			var $videoHolder = $videoDisplay.parent( '.videoHolder' );
			if( $videoHolder.parent( '.mwPlayerContainer' ).length == 0 ){
				this.$interface = $videoHolder.wrap(
						$('<div />')
						.addClass( 'mwPlayerContainer' )
					).parent()

				// merge in any inherited style if added
				if( embedPlayer.style.cssText ){
					this.$interface[0].style.cssText += embedPlayer.style.cssText;
				}
			} else {
				this.$interface = $videoHolder.parent( '.mwPlayerContainer' )
			}

			if( mw.isMobileDevice() ){
				this.$interface.addClass('mobile');
			}

			if( this.embedPlayer.isMobileSkin() ){
				this.$interface.addClass('mobileSkin');
			}

			if( mw.isTouchDevice() ){
				this.$interface.addClass('touch');
			}

			if (mw.isNativeApp()) {
				this.$interface.addClass('nativeApp');
			}

			if ( mw.isIE8() ) {
				this.$interface.addClass('ie8');
			}

			// Add our skin name as css class
			var skinName = embedPlayer.playerConfig.layout.skin;
			if (embedPlayer.getRawKalturaConfig("layout") && embedPlayer.getRawKalturaConfig("layout").skin){
				skinName = embedPlayer.getRawKalturaConfig("layout").skin;
			}
			this.$interface.addClass( skinName );

			// clear out base style
			embedPlayer.style.cssText = '';
		}
		return this.$interface;		
	},
	checkViewPort: function(){
		if ( mw.isMobileDevice() && mw.getConfig('EmbedPlayer.IsFriendlyIframe') ) {
			// add viewport meta tag if doesn't exist on the player parent page
			if ( parent.document.querySelector("meta[name=viewport]") == null ){
				try{
					var metaTag = parent.document.createElement('meta');
					metaTag.name = "viewport";
					metaTag.content = "width=device-width, initial-scale=1";
					parent.document.getElementsByTagName('head')[0].appendChild(metaTag);
				}catch(e){
					this.log("can't set viewport meta tag on parent document.");
				}
			}
		}
	},
	isInFullScreen: function() {
		return this.fullScreenManager.isInFullScreen();
	},
	/**
	* Get the control bar height
	* @return {Number} control bar height
	*/
	getHeight: function(){
		return this.embedPlayer.isMobileSkin() ? mw.getConfig( 'EmbedPlayer.MobileControlsHeight' ) : this.height;<commit_msg>Remove the adding of the viewport meta tag to customers page when missing (#3026)<commit_after>/**
* Msg text is inherited from embedPlayer
*/

( function( mw, $ ) { "use strict";
/**
* mw.PlayerLayoutBuilder object
*	@param the embedPlayer element we are targeting
*/
mw.PlayerLayoutBuilder = function( embedPlayer, options ) {
	return this.init( embedPlayer, options );
};

/**
 * ControlsBuilder prototype:
 */
mw.PlayerLayoutBuilder.prototype = {
	//Default Local values:

	// Default control bar height
	height: mw.getConfig( 'EmbedPlayer.ControlsHeight' ),

	// Default supported components is merged with embedPlayer set of supported types
	supportedComponents: {},

	// Flag to store if a warning binding has been added
	addWarningFlag: false,

	// Flag to store state of overlay on player
	displayOptionsMenuFlag: false,

	// Flag to store controls status (disabled/enabled)
	controlsDisabled: false,
	
	// binding postfix
	bindPostfix: '.layoutBuilder',

	layoutReady: false,

	keepControlsOnScreen: false,

	playingFlag: false,
	// Display importance available values
	importanceSet: ['low', 'medium', 'high'],

	/**
	* Initialization Object for the control builder
	*
	* @param {Object} embedPlayer EmbedPlayer interface
	*/
	init: function( embedPlayer ) {
		var _this = this;
		this.embedPlayer = embedPlayer;
		this.fullScreenManager = new mw.FullScreenManager( embedPlayer );
		var animationSupported = this.checkAnimationSupport();
		mw.setConfig( 'EmbedPlayer.AnimationSupported', animationSupported );
		this.addUserAgentCssClass();
		$(document.body).append($('<div style="display: block" class="cssChecker"></div>'));
		// Return the layoutBuilder Object:
		return this;
	},

	getInterface: function() {
		if( ! this.$interface ) {

			var embedPlayer = this.embedPlayer,
				$embedPlayer = $( embedPlayer );

			// build the videoDisplay wrapper if needed
			if( $embedPlayer.parent('.videoDisplay').length == 0 ){
				$embedPlayer.wrap(
					$('<div />').addClass( 'videoDisplay' )
				);
			}

			var $videoDisplay = $embedPlayer.parent('.videoDisplay');
			if( $videoDisplay.find('.videoShadow').length == 0 ){
				$(".mwEmbedPlayer").before('<div class="videoShadow"></div>');
			}
			// build the videoHolder wrapper if needed
			if( $videoDisplay.parent('.videoHolder').length == 0 ){
				$videoDisplay.parent('.videoDisplay').wrap(
					$('<div />').addClass( 'videoHolder')
				);
			}

			var $videoHolder = $videoDisplay.parent( '.videoHolder' );
			if( $videoHolder.parent( '.mwPlayerContainer' ).length == 0 ){
				this.$interface = $videoHolder.wrap(
						$('<div />')
						.addClass( 'mwPlayerContainer' )
					).parent()

				// merge in any inherited style if added
				if( embedPlayer.style.cssText ){
					this.$interface[0].style.cssText += embedPlayer.style.cssText;
				}
			} else {
				this.$interface = $videoHolder.parent( '.mwPlayerContainer' )
			}

			if( mw.isMobileDevice() ){
				this.$interface.addClass('mobile');
			}

			if( this.embedPlayer.isMobileSkin() ){
				this.$interface.addClass('mobileSkin');
			}

			if( mw.isTouchDevice() ){
				this.$interface.addClass('touch');
			}

			if (mw.isNativeApp()) {
				this.$interface.addClass('nativeApp');
			}

			if ( mw.isIE8() ) {
				this.$interface.addClass('ie8');
			}

			// Add our skin name as css class
			var skinName = embedPlayer.playerConfig.layout.skin;
			if (embedPlayer.getRawKalturaConfig("layout") && embedPlayer.getRawKalturaConfig("layout").skin){
				skinName = embedPlayer.getRawKalturaConfig("layout").skin;
			}
			this.$interface.addClass( skinName );

			// clear out base style
			embedPlayer.style.cssText = '';
		}
		return this.$interface;		
	},
	isInFullScreen: function() {
		return this.fullScreenManager.isInFullScreen();
	},
	/**
	* Get the control bar height
	* @return {Number} control bar height
	*/
	getHeight: function(){
		return this.embedPlayer.isMobileSkin() ? mw.getConfig( 'EmbedPlayer.MobileControlsHeight' ) : this.height;
{'fraction_non_alphanumeric': 0.14475540921919097, 'fraction_numerical': 0.0023518344308560675, 'mean_word_length': 3.8214285714285716, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6643424', 'n_tokens_mistral': 2944, 'n_tokens_neox': 2504, 'n_words': 600}