<commit_before>/*
 * The "kaltura player" embedPlayer interface for fallback h.264 and flv video format support
 * See http://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript for formating conventions
 */
( function( mw, $ ){ "use strict";

	window['mwePlayerId'];
	mw.EmbedPlayerYouTube = {

		//test comment for testing pull request

		// Instance name:
		instanceOf : 'YouTube',

		bindPostfix: '.YouTube',

		playerPrefix: 'EmbedPlayerYouTube',

		//current playhead time
		time : 0,
		//current entry duration
		duration : 0,
		// A flag to store if the player has already been embed or not
		playerEmbedFlag: false,
		//Flag holdinng end state
		hasEnded: false,
		ytMobilePlayed: false,
		//the youtube entry id
		youtubeEntryId : "",
		playerReady: null,
		isPlaylist: false,
		//the youtube preFix
		//TODO grab from a configuration
		youtubePreFix : "//www.youtube.com/apiplayer?video_id=",
		youtubeProtocol : "http:",
		// List of supported features:
		supports : {
			'playHead' :  (mw.getConfig('previewMode') == null) ? true : false ,
			'pause' : true,
			'stop' : true,
			'timeDisplay' : true,
			'volumeControl' : true,
			'overlays' : true,
			'fullscreen' : (mw.getConfig('previewMode') == null) ? true : false
		},
		init: function(){
			this._playContorls = false;
			this.playerReady = $.Deferred();
		},

        loadYTPlayer: function(){
			var _this = this;
			//move to the other scope
			$('.ui-icon-image').hide();
			$('.timed-text').hide();
			$('.ui-icon-arrowthickstop-1-s').hide();
			$('.ui-icon-flag').hide();
			this.isPlaylist = this.playlist;
			var playerVars;
			//basic configuration
			playerVars = {
				controls: 0,
				iv_load_policy: 3,
                rel: 0,
				fs: 0,
				wmode: 'opaque',
				showinfo: 0,
				start: this.startTime || undefined,
				end: this.pauseTime || undefined
			};

			if(window['KeyValueParams']) {
				var kevarsArray = window['KeyValueParams'].split("&");
				for(var i=0;i<kevarsArray.length;i++){
					var kv = kevarsArray[i].split("=");
					playerVars[kv[0]] = kv[1];
				}

			}
			this.playerElement = new YT.Player(this.pid, {
				height: "100%",
				width: "100%",
				videoId: this.youtubeEntryId,
				playerVars: playerVars,
				events: {
					"onReady": function(event){_this.onIframePlayerReady(event);},
					"onError": function(event){_this.onError(event);},
					"onStateChange": function(event){_this.onPlayerStateChange(event);}
				}
			});
		},
        onIframePlayerReady: function( event ){
            window['iframePlayer'] = event.target;
            this.setDuration();
            this._playContorls = true;
            this.playerReady.resolve();
            this.triggerHelper('playerReady');
            //autoMute
            if(mw.getConfig('autoMute')){
                this.setVolume(0);
            }
            //autoplay
            if(mw.getConfig('autoPlay') && this.canAutoPlay()){
                this.unbindHelper("preSeek");
                this.play();
            }else{
                window['hidePlayer']();
            }<commit_msg>SUP-13280-Remove support check for Windows phone on mobile skin (#3737)<commit_after>/*
 * The "kaltura player" embedPlayer interface for fallback h.264 and flv video format support
 * See http://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript for formating conventions
 */
( function( mw, $ ){ "use strict";

	window['mwePlayerId'];
	mw.EmbedPlayerYouTube = {

		//test comment for testing pull request

		// Instance name:
		instanceOf : 'YouTube',

		bindPostfix: '.YouTube',

		playerPrefix: 'EmbedPlayerYouTube',

		//current playhead time
		time : 0,
		//current entry duration
		duration : 0,
		// A flag to store if the player has already been embed or not
		playerEmbedFlag: false,
		//Flag holdinng end state
		hasEnded: false,
		ytMobilePlayed: false,
		//the youtube entry id
		youtubeEntryId : "",
		playerReady: null,
		isPlaylist: false,
		//the youtube preFix
		//TODO grab from a configuration
		youtubePreFix : "//www.youtube.com/apiplayer?video_id=",
		youtubeProtocol : "http:",
		// List of supported features:
		supports : {
			'playHead' :  (mw.getConfig('previewMode') == null) ? true : false ,
			'pause' : true,
			'stop' : true,
			'timeDisplay' : true,
			'volumeControl' : true,
			'overlays' : true,
			'fullscreen' : (mw.getConfig('previewMode') == null) ? true : false
		},
		init: function(){
			this._playContorls = false;
			this.playerReady = $.Deferred();
		},

        loadYTPlayer: function(){
			var _this = this;
			//move to the other scope
			$('.ui-icon-image').hide();
			$('.timed-text').hide();
			$('.ui-icon-arrowthickstop-1-s').hide();
			$('.ui-icon-flag').hide();
			this.isPlaylist = this.playlist;
			var playerVars;
			//basic configuration
			playerVars = {
				controls: 0,
				iv_load_policy: 3,
                rel: 0,
				fs: 0,
				wmode: 'opaque',
				showinfo: 0,
				start: this.startTime || undefined,
				end: this.pauseTime || undefined
			};

			if(window['KeyValueParams']) {
				var kevarsArray = window['KeyValueParams'].split("&");
				for(var i=0;i<kevarsArray.length;i++){
					var kv = kevarsArray[i].split("=");
					playerVars[kv[0]] = kv[1];
				}

			}
			this.playerElement = new YT.Player(this.pid, {
				height: "100%",
				width: "100%",
				videoId: this.youtubeEntryId,
				playerVars: playerVars,
				events: {
					"onReady": function(event){_this.onIframePlayerReady(event);},
					"onError": function(event){_this.onError(event);},
					"onStateChange": function(event){_this.onPlayerStateChange(event);}
				}
			});
		},
        onIframePlayerReady: function( event ){
            window['iframePlayer'] = event.target;
            this.setDuration();
            this._playContorls = true;
            this.playerReady.resolve();
            this.triggerHelper('playerReady');
            //autoMute
            if(mw.getConfig('autoMute')){
                this.setVolume(0);
            }
            //autoplay
            if(mw.getConfig('autoPlay') && this.canAutoPlay()){
                this.unbindHelper("preSeek");
                this.play();
            }
{'fraction_non_alphanumeric': 0.14916137436899526, 'fraction_numerical': 0.008304836345872008, 'mean_word_length': 2.7, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '4890100', 'n_tokens_mistral': 2326, 'n_tokens_neox': 1958, 'n_words': 431}