<commit_before>// Wrap in mw
( function( mw, $ ) {
// Check for new Embed Player events: 
$( mw ).bind( 'newEmbedPlayerEvent', function( event, embedPlayer ){
	// Check for KalturaSupport uiConf
	$( embedPlayer ).bind( 'KalturaSupport_CheckUiConf', function( event, $uiConf, callback ){
		// Old closeCaption plugin
		var oldCaptionConfig = embedPlayer.getKalturaConfig(
				'closedCaptions', 
				[ 'plugin', 'relativeTo', 'position', 'width', 'height', 'skin', 'bg',
				 'fontsize', 'opacity', 'fontFamily', 'type',  'ccUrl', 'timeOffset',
				 'hideClosedCaptions' ]
		);

		// closeCaption Under player plugin
		var underCaptionConfig = embedPlayer.getKalturaConfig(
				'closedCaptionsUnderPlayer', 
				[ 'plugin', 'width', 'height', 'fontsize', 'bg', 'fontcolor', 'opacity', 
				  'fontFamily', 'timeOffset', 'hideClosedCaptions' ]
		);

		var playerOverConfig = [ 'plugin', 'width', 'height', 'fontsize', 'bg', 'fontColor', 'opacity',
				'fontFamily', 'useGlow', 'glowColor', 'glowBlur', 'timeOffset', 
				'hideClosedCaptions' ];
		
		// CloseCaption Over player plugin
		var overCaptionConfig = embedPlayer.getKalturaConfig( 'closedCaptionsOverPlayer', playerOverConfig );
		
		// Check for alternate name for closedCaptionsOverPlayer
		if( ! overCaptionConfig ){
			overCaptionConfig = embedPlayer.getKalturaConfig( 'closedCaptionsFlexible', playerOverConfig );
		}

		// Select the available plugin
		var captionConfig = { plugin: false };
		if( oldCaptionConfig && oldCaptionConfig.plugin ) {
			captionConfig = oldCaptionConfig;
		} else if( underCaptionConfig && underCaptionConfig.plugin ) {
			captionConfig = underCaptionConfig;
		} else if( overCaptionConfig && overCaptionConfig.plugin ) {
			captionConfig = overCaptionConfig;
		}

		if( captionConfig.plugin ){<commit_msg>check for plugin not just the empty object<commit_after>// Wrap in mw
( function( mw, $ ) {
// Check for new Embed Player events: 
$( mw ).bind( 'newEmbedPlayerEvent', function( event, embedPlayer ){
	// Check for KalturaSupport uiConf
	$( embedPlayer ).bind( 'KalturaSupport_CheckUiConf', function( event, $uiConf, callback ){
		// Old closeCaption plugin
		var oldCaptionConfig = embedPlayer.getKalturaConfig(
				'closedCaptions', 
				[ 'plugin', 'relativeTo', 'position', 'width', 'height', 'skin', 'bg',
				 'fontsize', 'opacity', 'fontFamily', 'type',  'ccUrl', 'timeOffset',
				 'hideClosedCaptions' ]
		);

		// closeCaption Under player plugin
		var underCaptionConfig = embedPlayer.getKalturaConfig(
				'closedCaptionsUnderPlayer', 
				[ 'plugin', 'width', 'height', 'fontsize', 'bg', 'fontcolor', 'opacity', 
				  'fontFamily', 'timeOffset', 'hideClosedCaptions' ]
		);

		var playerOverConfig = [ 'plugin', 'width', 'height', 'fontsize', 'bg', 'fontColor', 'opacity',
				'fontFamily', 'useGlow', 'glowColor', 'glowBlur', 'timeOffset', 
				'hideClosedCaptions' ];
		
		// CloseCaption Over player plugin
		var overCaptionConfig = embedPlayer.getKalturaConfig( 'closedCaptionsOverPlayer', playerOverConfig );
		
		// Check for alternate name for closedCaptionsOverPlayer
		if( !overCaptionConfig || ! overCaptionConfig.plugin ){
			overCaptionConfig = embedPlayer.getKalturaConfig( 'closedCaptionsFlexible', playerOverConfig );
		}

		// Select the available plugin
		var captionConfig = { plugin: false };
		if( oldCaptionConfig && oldCaptionConfig.plugin ) {
			captionConfig = oldCaptionConfig;
		} else if( underCaptionConfig && underCaptionConfig.plugin ) {
			captionConfig = underCaptionConfig;
		} else if( overCaptionConfig && overCaptionConfig.plugin ) {
			captionConfig = overCaptionConfig;
		}

		if( captionConfig.plugin ){
{'fraction_non_alphanumeric': 0.1330777656078861, 'fraction_numerical': 0.0, 'mean_word_length': 4.681181959564541, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5213910', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1099, 'n_words': 270}