<commit_before><?php
/**
 * EmbedVideo
 * EmbedVideo Hooks
 *
 * @license		MIT
 * @package		EmbedVideo
 * @link		https://www.mediawiki.org/wiki/Extension:EmbedVideo
 *
 **/

class EmbedVideoHooks {
	/**
	 * Temporary storage for the current service object.
	 *
	 * @var		object
	 */
	static private $service;

	/**
	 * Description Parameter
	 *
	 * @var		string
	 */
	static private $description = false;

	/**
	 * Alignment Parameter
	 *
	 * @var		string
	 */
	static private $alignment = false;

	/**
	 * Container Parameter
	 *
	 * @var		string
	 */
	static private $container = false;

	/**
	 * Valid Arguments for the parseEV function hook.
	 *
	 * @var		string
	 */
	static private $validArguments = [
		'service'		=> null,
		'id'			=> null,
		'dimensions'	=> null,
		'alignment'		=> null,
		'description'	=> null,
		'container'		=> null,
		'urlargs'		=> null,
		'autoresize'	=> null
	];

	/**
	 * Hook to setup defaults.
	 *
	 * @access	public
	 * @return	void
	 */
	public static function onExtension() {
		global $wgEmbedVideoDefaultWidth, $wgMediaHandlers, $wgFileExtensions;

		if ( !isset($wgEmbedVideoDefaultWidth) && (isset($_SERVER['HTTP_X_MOBILE']) && $_SERVER['HTTP_X_MOBILE'] == 'true') && $_COOKIE['stopMobileRedirect'] != 1 ) {
			//Set a smaller default width when in mobile view.
			$wgEmbedVideoDefaultWidth = 320;
		}

		$wgMediaHandlers['audio/flac']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/ogg']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/mpeg']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/mp4']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/wav']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/webm']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/x-flac']		= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['video/mp4']			= 'EmbedVideo\VideoHandler';
		$wgMediaHandlers['video/ogg']			= 'EmbedVideo\VideoHandler';
		$wgMediaHandlers['video/quicktime']		= 'EmbedVideo\VideoHandler';
		$wgMediaHandlers['video/webm']			= 'EmbedVideo\VideoHandler';
		$wgMediaHandlers['video/x-matroska']	= 'EmbedVideo\VideoHandler';

		$wgFileExtensions[] = 'flac';
		$wgFileExtensions[] = 'mkv';
		$wgFileExtensions[] = 'mov';
		$wgFileExtensions[] = 'mp3';
		$wgFileExtensions[] = 'mp4';
		$wgFileExtensions[] = 'ogg';
		$wgFileExtensions[] = 'wav';
		$wgFileExtensions[] = 'webm';<commit_msg>Add couple variants.<commit_after><?php
/**
 * EmbedVideo
 * EmbedVideo Hooks
 *
 * @license		MIT
 * @package		EmbedVideo
 * @link		https://www.mediawiki.org/wiki/Extension:EmbedVideo
 *
 **/

class EmbedVideoHooks {
	/**
	 * Temporary storage for the current service object.
	 *
	 * @var		object
	 */
	static private $service;

	/**
	 * Description Parameter
	 *
	 * @var		string
	 */
	static private $description = false;

	/**
	 * Alignment Parameter
	 *
	 * @var		string
	 */
	static private $alignment = false;

	/**
	 * Container Parameter
	 *
	 * @var		string
	 */
	static private $container = false;

	/**
	 * Valid Arguments for the parseEV function hook.
	 *
	 * @var		string
	 */
	static private $validArguments = [
		'service'		=> null,
		'id'			=> null,
		'dimensions'	=> null,
		'alignment'		=> null,
		'description'	=> null,
		'container'		=> null,
		'urlargs'		=> null,
		'autoresize'	=> null
	];

	/**
	 * Hook to setup defaults.
	 *
	 * @access	public
	 * @return	void
	 */
	public static function onExtension() {
		global $wgEmbedVideoDefaultWidth, $wgMediaHandlers, $wgFileExtensions;

		if ( !isset($wgEmbedVideoDefaultWidth) && (isset($_SERVER['HTTP_X_MOBILE']) && $_SERVER['HTTP_X_MOBILE'] == 'true') && $_COOKIE['stopMobileRedirect'] != 1 ) {
			//Set a smaller default width when in mobile view.
			$wgEmbedVideoDefaultWidth = 320;
		}

		$wgMediaHandlers['audio/flac']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/ogg']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/mpeg']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/mp4']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/wav']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/webm']			= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['audio/x-flac']		= 'EmbedVideo\AudioHandler';
		$wgMediaHandlers['video/mp4']			= 'EmbedVideo\VideoHandler';
		$wgMediaHandlers['video/ogg']			= 'EmbedVideo\VideoHandler';
		$wgMediaHandlers['video/quicktime']		= 'EmbedVideo\VideoHandler';
		$wgMediaHandlers['video/webm']			= 'EmbedVideo\VideoHandler';
		$wgMediaHandlers['video/x-matroska']	= 'EmbedVideo\VideoHandler';

		$wgFileExtensions[] = 'flac';
		$wgFileExtensions[] = 'mkv';
		$wgFileExtensions[] = 'mov';
		$wgFileExtensions[] = 'mp3';
		$wgFileExtensions[] = 'mp4';
		$wgFileExtensions[] = 'oga';
		$wgFileExtensions[] = 'ogg';
		$wgFileExtensions[] = 'ogv';
		$wgFileExtensions[] = 'wav';
		$wgFileExtensions[] = 'webm';
{'fraction_non_alphanumeric': 0.16400580551523947, 'fraction_numerical': 0.0033174372797014308, 'mean_word_length': 4.067226890756302, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '469392', 'n_tokens_mistral': 1921, 'n_tokens_neox': 1667, 'n_words': 305}