/**
  * Initialize the class and set its properties.
  *
  * @since    1.0.0
  * @var      string    $plugin_slug       The name of the plugin.
  * @var      string    $version    The version of this plugin.
  */
 public function __construct($plugin_slug, $version)
 {
     $this->plugin_slug = $plugin_slug;
     $this->version = $version;
     $arve_shared = new Advanced_Responsive_Video_Embedder_Shared();
     $this->options = $arve_shared->get_options();
     $this->regex_list = $arve_shared->get_regex_list();
 }
 public function validate_options_shortcodes($input)
 {
     $output = array();
     //* Storing the Options Section as a empty array will cause the plugin to use defaults
     if (isset($input['reset'])) {
         return array();
     }
     foreach ($input as $key => $var) {
         $var = preg_replace('/[_]+/', '_', $var);
         // remove multiple underscores
         $var = preg_replace('/[^A-Za-z0-9_]/', '', $var);
         // strip away everything except a-z,0-9 and underscores
         if (strlen($var) < 3) {
             continue;
         }
         $output[$key] = $var;
     }
     $options_defaults = Advanced_Responsive_Video_Embedder_Shared::get_options_defaults('shortcodes');
     //* Store only the options in the database that are different from the defaults.
     return array_diff_assoc($output, $options_defaults);
 }
<?php

/**
 * Represents the view for the administration dashboard.
 *
 * This includes the header, options, and other information that should provide
 * The User Interface to the end user.
 *
 * @package   Advanced_Responsive_Video_Embedder
 * @author    Nicolas Jonas
 * @license   GPL-3.0+
 * @link      http://nextgenthemes.com
 * @copyright 2013 Nicolas Jonas
 */
$options = Advanced_Responsive_Video_Embedder_Shared::get_options();
?>
<div class="wrap arve-options-wrap">

	<h2><?php 
echo esc_html(get_admin_page_title());
?>
</h2>

	<?php 
if ($admin_message = $this->get_admin_message()) {
    echo '<div class="updated">' . $admin_message . '</div>';
}
?>

	<h2 class="nav-tab-wrapper arve-settings-tabs"></h2>
	
 public function tests_shortcode($args, $content = null)
 {
     if (!is_singular()) {
         return $content;
     }
     $tests = array('align-tests' => array('[vimeo id="23316783"] This text should apper below the video', '[vimeo id="23316783" align=center]', '[vimeo id="23316783" align=left] This text should appear right next to the video', '[vimeo id="23316783" align=right] This text should appear left next to the video'), 'maxwidth-test' => array('This video should be not wider then 444px in normal and lazyload mode and display centered', '[vimeo id="23316783" maxwidth="444" align="center"]'), 'archiveorg' => array('https://archive.org/details/AlexJonesInterviewsDeanHaglund'), 'blip' => array('http://blip.tv/the-spoony-experiment/b-fest-2014-recap-part-1-of-2-6723548'), 'break' => array('http://www.break.com/video/first-person-pov-of-tornado-strike-2542591'), 'collegehumor' => array('http://collegehumor.com/video/6922670/bleep-bloop-your-best-game'), 'comedycentral' => array('[comedycentral id="c80adf02-3e24-437a-8087-d6b77060571c"]'), 'dailymotion' => array('http://www.dailymotion.com/video/x44lvd_rates-of-exchange-like-a-renegade_music', __('URL just the ID withoutout the long title', $this->plugin_slug), 'http://www.dailymotion.com/video/x44lvd', __('URL from a hub with the Video ID at the end', $this->plugin_slug), 'http://www.dailymotion.com/hub/x9q_Galatasaray#video=xjw21s', __('Playlist', $this->plugin_slug), 'http://www.dailymotion.com/playlist/xr2rp_RTnews_exclusive-interveiws/1#video=xafhh9'), 'flickr' => array('[flickr id="2856467015"]'), 'funnyordie' => array('http://www.funnyordie.com/videos/76585438d8/sarah-silverman-s-we-are-miracles-hbo-special'), 'gametrailers' => array('[gametrailers id="797121a1-4685-4ecc-9388-72a88b0ef8da"]'), 'iframe' => array(__('This plugin allows iframe embeds for every URL by using this <code>[iframe]</code> shortcode. This should only be used for providers not supported by this via a named shortcode. The result is a 16:9 resonsive iframe by default, aspect ratio can be changed as usual.', $this->plugin_slug), '[iframe id="http://example.com/"]', esc_html__('This can also be used to have limited support for self hosted videos my passing URLs to .webm, .mp4 or .ogg to it. This might not be the best way to do because this is what the <video> tag is for but it works in my tests.', $this->plugin_slug), '[iframe id="http://video.webmfiles.org/big-buck-bunny_trailer.webm"]'), 'ign' => array('http://www.ign.com/videos/2012/03/06/mass-effect-3-video-review'), 'kickstarter' => array('https://www.kickstarter.com/projects/obsidian/project-eternity?ref=discovery'), 'liveleak' => array(__('Page/item <code>i=</code> URL', $this->plugin_slug), 'http://www.liveleak.com/view?i=703_1385224413', __('File <code>f=</code> URL', $this->plugin_slug), 'http://www.liveleak.com/view?f=c85bdf5e45b2'), 'metacafe' => array('http://www.metacafe.com/watch/11159703/why_youre_fat/', 'http://www.metacafe.com/watch/11322264/everything_wrong_with_robocop_in_7_minutes/'), 'movieweb' => array('[movieweb id="VIwFzmdbyoy9zB"]'), 'mpora' => array('http://mpora.com/videos/AAdphry14rkn', 'http://mpora.de/videos/AAdpxhiv6pqd'), 'myspace' => array('https://myspace.com/myspace/video/dark-rooms-the-shadow-that-looms-o-er-my-heart-live-/109471212'), 'myvideo' => array('http://www.myvideo.de/watch/8432624/Angeln_mal_anders'), 'snotr' => array('http://www.snotr.com/video/12314/How_big_a_truck_blind_spot_really_is'), 'spike' => array('[spike id="5afddf30-31d8-40fb-81e6-bb5c6f45525f"]'), 'ted' => array(__('To my knowlege TED forces autoplay and there is no way disable it', $this->plugin_slug), 'http://ted.com/talks/jill_bolte_taylor_s_powerful_stroke_of_insight', __('Beta site URLs work as well', $this->plugin_slug), 'http://new.ted.com/talks/brene_brown_on_vulnerability'), 'twitch' => array('http://www.twitch.tv/tsm_dyrus', __('Past breadcast URL', $this->plugin_slug), 'http://www.twitch.tv/tsm_dyrus/b/500898967', __('Highlight URL', $this->plugin_slug), 'http://www.twitch.tv/tsm_dyrus/c/3674140'), 'ustream' => array(__('To my knowlege Ustream forces autoplay and there is no way disable it', $this->plugin_slug), __('Channel URL - get them from the share button URLS with names instead of numeric IDs will not work!', $this->plugin_slug), 'http://www.ustream.tv/channel/15844301', __('Recorded URL', $this->plugin_slug), 'http://www.ustream.tv/recorded/40976103', __('Highlight URL', $this->plugin_slug), 'http://www.ustream.tv/recorded/31217313/highlight/344029'), 'veoh' => array('http://www.veoh.com/watch/v19866882CAdjNF9b'), 'vevo' => array('http://www.vevo.com/watch/the-offspring/the-kids-arent-alright/USSM20100649', '[vevo id="US4E51286201"]'), 'viddler' => array('http://www.viddler.com/v/a695c468'), 'videojug' => array('[videojug id="fa15cafd-556f-165b-d660-ff0008c90d2d"]'), 'viddler' => array('http://www.viddler.com/v/a695c468'), 'vimeo' => array('[vimeo id="12901672"]', 'http://vimeo.com/23316783'), 'vine' => array('[vine id="MbrreglaFrA"]', 'https://vine.co/v/bjAaLxQvOnQ', 'https://vine.co/v/bjHh0zHdgZT/embed'), 'yahoo' => array('http://screen.yahoo.com/buzzfeed/eye-opening-facts-vaginas-210102842.html'), 'youtube' => array('http://www.youtube.com/watch?v=vrXgLhkv21Y', __('URL from youtu.be shortener', $this->plugin_slug), 'http://youtu.be/3Y8B93r2gKg', __('Youtube playlist URL inlusive the video to start at. The index part will be ignored and is not needed', $this->plugin_slug), 'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10', __('Loop a YouTube video', $this->plugin_slug), '[youtube id="FKkejo2dMV4" parameters="playlist=FKkejo2dMV4 loop=1"]', __('Enable annotations and light theme', $this->plugin_slug), '[youtube id="uCQXKYPiz6M" parameters="iv_load_policy=1 theme=light"]'), 'youtube-starttimes' => array('http://youtu.be/vrXgLhkv21Y?t=1h19m14s', 'http://youtu.be/vrXgLhkv21Y?t=19m14s', 'http://youtu.be/vrXgLhkv21Y?t=1h', 'http://youtu.be/vrXgLhkv21Y?t=5m', 'http://youtu.be/vrXgLhkv21Y?t=30s', __('The Parameter start only takes values in seconds, this will start the video at 1 minute and 1 second', $this->plugin_slug), '[youtube id="uCQXKYPiz6M" parameters="start=61"]'));
     $get_provider = $get_mode = $selected_mode = false;
     if (!empty($_GET['arvet-provider'])) {
         $get_provider = $_GET['arvet-provider'];
     }
     if (!empty($_GET['arvet-mode'])) {
         $selected_mode = $_GET['arvet-mode'];
         if ($_GET['arvet-mode'] !== $this->options['mode']) {
             $get_mode = $_GET['arvet-mode'];
         }
     }
     $provider_options = $mode_options = '';
     foreach ($tests as $provider => $value) {
         $provider_options .= sprintf('<option%s value="%s">%s</option>', selected($provider, $get_provider, false), esc_attr($provider), esc_html($provider));
     }
     $form = '<p><form method="get">' . sprintf('<select name="arvet-provider">%s</select>', $provider_options) . sprintf('<select name="arvet-mode">%s</select>', Advanced_Responsive_Video_Embedder_Shared::get_mode_options($this->plugin_slug, $get_mode)) . ' Debug output? <input type="checkbox" name="arve-debug">' . sprintf('<button tyle="submit">%s</button>', __('Test', $this->plugin_slug)) . '</form></p>';
     $content = $form;
     if ($get_provider) {
         foreach ($tests[$get_provider] as $line) {
             if ($this->begins_with($line, 'http')) {
                 global $wp_embed;
                 $line = add_query_arg('arve-mode', $get_mode, $line);
                 $content .= sprintf('<code>%s</code></p><p>%s</p>', esc_html($line), $wp_embed->autoembed($line));
                 $content .= '<div style="display: block; clear: both;"></div><br><hr><br>';
             } elseif ($this->begins_with($line, '[')) {
                 if ($get_mode) {
                     $line = str_replace(']', sprintf(' mode="%s"]', esc_attr($get_mode)), $line);
                 }
                 $content .= sprintf('<code>%s</code></p><p>%s</p>', esc_html($line), do_shortcode($line));
                 $content .= '<div style="display: block; clear: both;"></div><br><hr><br>';
             } else {
                 $content .= "<p>{$line}</p>";
             }
         }
     }
     return $content;
 }
			<?php 
_e('For Blip.tv, Videojug, Movieweb, Gametrailers, Yahoo!, Spike, Comedycentral and general iframe embed codes paste the embed code, for all others paste the URL! Ustream: If your Address bar URL not contains a number, click the Share->URL icons and paste that URL.', $this->plugin_slug);
?>
		</small>

		<textarea id="arve-url" rows="4" value=""></textarea><br>

		<div class="arve-input-group">
			<label for="arve-mode"><?php 
_e('Mode', $this->plugin_slug);
?>
</label>
			<select id="arve-mode">
				<option value=""></option>
				<?php 
echo Advanced_Responsive_Video_Embedder_Shared::get_mode_options($this->plugin_slug);
?>
			</select>
		</div>
	
		<div class="arve-input-group">
			<label for="arve-align"><?php 
_e('Align', $this->plugin_slug);
?>
</label>
			<select id="arve-align">
				<option value=""></option>
				<option value="left"><?php 
_e('left', $this->plugin_slug);
?>
</option>
 /**
  *
  *
  * @since    2.6.0
  */
 public function build_embed($provider, $atts)
 {
     $object_params_autoplay_yes = $object_params_autoplay_no = '';
     $output = '';
     $iframe = true;
     $properties = $this->get_properties();
     $shortcode_atts_defaults = array('align' => null, 'aspect_ratio' => (double) $properties[$provider]['aspect_ratio'], 'autoplay' => (bool) $this->options['autoplay'], 'id' => null, 'lang' => null, 'maxwidth' => null, 'mode' => (string) $this->options['mode'], 'parameters' => null, 'start' => null, 'thumbnail' => null, 'link_text' => null, 'grow' => null);
     $atts = shortcode_atts($shortcode_atts_defaults, $atts, $this->options['shortcodes'][$provider]);
     extract($atts);
     $maxwidth = (int) $maxwidth;
     $aspect_ratio = $this->aspect_ratio_to_padding($aspect_ratio);
     $thumbnail = trim($thumbnail);
     if ('dailymotionlist' === $provider) {
         switch ($mode) {
             case 'normal':
             case 'lazyload':
             case 'lazyload-fixed':
             case 'lazyload-fullscreen':
                 $aspect_ratio = 72;
                 break;
         }
     }
     if (empty($id)) {
         return $this->error(__('no id set', $this->plugin_slug));
     } elseif (!preg_match('/[^\\x20-\\x7f]/', $provider)) {
         // fine
     } else {
         return $this->error(sprintf(__('Provider <code>%s</code> not valid', $this->plugin_slug), esc_html($provider)));
     }
     switch ($align) {
         case null:
         case '':
             break;
         case 'left':
         case 'right':
         case 'center':
             $align = "align{$align}";
             break;
         default:
             return $this->error(sprintf(__('Align <code>%s</code> not valid', $this->plugin_slug), esc_html($align)));
             break;
     }
     if ('thumbnail' === $mode) {
         $mode = 'lazyload-lightbox';
     }
     $supported_modes = Advanced_Responsive_Video_Embedder_Shared::get_supported_modes();
     if (!array_key_exists($mode, $supported_modes)) {
         return $this->error(sprintf(__('Mode: <code>%s</code> is invalid or not supported. Note that you will need the Pro Addon for lazyload modes.', $this->plugin_slug), esc_html($mode)));
     }
     if ($maxwidth < 100 && in_array($align, array('alignleft', 'alignright', 'aligncenter'))) {
         $maxwidth = (int) $this->options['align_maxwidth'];
     }
     $maxwidth = apply_filters('arve_maxwidth', $maxwidth, $align, $mode);
     switch ($autoplay) {
         case null:
         case '':
             break;
         case 'true':
         case '1':
         case 'yes':
             $autoplay = true;
             break;
         case 'false':
         case '0':
         case 'no':
             $autoplay = false;
             break;
         default:
             return $this->error(sprintf(__('Autoplay <code>%s</code> not valid', $this->plugin_slug), $autoplay));
             break;
     }
     switch ($start) {
         case null:
         case '':
         case preg_match("/^[0-9a-z]\$/", $start):
             break;
         default:
             return $this->error(sprintf(__('Start <code>%s</code> not valid', $this->plugin_slug), $start));
             break;
     }
     switch ($provider) {
         case '4players':
             $url = 'http://www.4players.de/4players.php/tvplayer_embed/4PlayersTV/' . $id;
             break;
         case 'alugha':
             $url = 'https://alugha.com/embed/polymer-live/?v=' . $id;
             break;
         case 'metacafe':
             $url = 'http://www.metacafe.com/embed/' . $id . '/';
             break;
         case 'liveleak':
             //* For backwards compatibilty and possible mistakes
             if ($id[0] != 'f' && $id[0] != 'i') {
                 $id = 'i=' . $id;
             }
             $url = 'http://www.liveleak.com/ll_embed?' . $id;
             break;
         case 'myspace':
             $url = 'https://myspace.com/play/video/' . $id;
             break;
         case 'blip':
             if ($blip_xml = simplexml_load_file('http://blip.tv/rss/view/' . $id)) {
                 $blip_result = $blip_xml->xpath("/rss/channel/item/blip:embedLookup");
                 $id = (string) $blip_result[0];
             } else {
                 return $this->error(__('Could not get Blip.tv embed ID', $this->plugin_slug));
             }
         case 'bliptv':
             //* Deprecated
             $url = 'http://blip.tv/play/' . $id . '.html?p=1&backcolor=0x000000&lightcolor=0xffffff';
             break;
         case 'collegehumor':
             $url = 'http://www.collegehumor.com/e/' . $id;
             break;
         case 'videojug':
             $url = 'http://www.videojug.com/embed/' . $id;
             break;
         case 'veoh':
             $url = 'http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1396&permalinkId=' . $id;
             $object_params = sprintf('<param name="movie" value="%s" />', esc_url($url));
             break;
         case 'break':
             $url = 'http://break.com/embed/' . $id;
             break;
         case 'dailymotion':
             $url = '//www.dailymotion.com/embed/video/' . $id;
             break;
         case 'dailymotionlist':
             $url = '//www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2F' . $id . '%2F1';
             break;
         case 'movieweb':
             $url = 'http://www.movieweb.com/v/' . $id;
             break;
         case 'mpora':
             $url = 'http://mpora.com/videos/' . $id . '/embed';
             break;
         case 'myvideo':
             $url = '//www.myvideo.de/embed/' . $id;
             break;
         case 'vimeo':
             $url = '//player.vimeo.com/video/' . $id;
             break;
         case 'gametrailers':
             $url = 'http://media.mtvnservices.com/embed/mgid:arc:video:gametrailers.com:' . $id;
             break;
         case 'comedycentral':
             $url = 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:' . $id;
             break;
         case 'spike':
             $url = 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:' . $id;
             break;
         case 'viddler':
             $url = '//www.viddler.com/player/' . $id . '/';
             break;
         case 'snotr':
             $url = 'http://www.snotr.com/embed/' . $id;
             break;
         case 'funnyordie':
             $url = 'http://www.funnyordie.com/embed/' . $id;
             break;
         case 'youtube':
             $id = str_replace(array('&list=', '&amp;list='), '?list=', $id);
             $url = '//www.youtube.com/embed/' . $id;
             # TODO switch back to -nocookie.com when YT resolves issue
             break;
         case 'youtubelist':
             //* DEPRICATED
             $url = '//www.youtube.com/embed/videoseries?list=' . $id . '&wmode=transparent&rel=0&autohide=1&hd=1&iv_load_policy=3';
             break;
         case 'archiveorg':
             $url = 'http://www.archive.org/embed/' . $id . '/';
             break;
         case 'flickr':
             $url = 'http://www.flickr.com/apps/video/stewart.swf?v=109786';
             $object_params = '<param name="flashvars" value="intl_lang=en-us&photo_secret=9da70ced92&photo_id=' . $id . '"></param>';
             break;
         case 'ustream':
             $url = 'http://www.ustream.tv/embed/' . $id . '?v=3&wmode=transparent';
             break;
         case 'yahoo':
             $id = str_ireplace(array('screen.yahoo,com/', 'screen.yahoo.com/embed/'), '', $id);
             $url = 'http://screen.yahoo.com/embed/' . $id . '.html';
             break;
         case 'vevo':
             $url = 'http://cache.vevo.com/assets/html/embed.html?video=' . $id;
             break;
         case 'ted':
             if (preg_match("/^[a-z]{2}\$/", $lang) === 1) {
                 $url = "https://embed-ssl.ted.com/talks/lang/{$lang}/{$id}.html";
             } else {
                 $url = "https://embed-ssl.ted.com/talks/{$id}.html";
             }
             break;
         case 'iframe':
             $url = $id;
             break;
         case 'kickstarter':
             $url = 'http://www.kickstarter.com/projects/' . $id . '/widget/video.html';
             break;
         case 'ign':
             $url = 'http://widgets.ign.com/video/embed/content.html?url=' . $id;
             break;
         case 'xtube':
             $url = 'http://www.xtube.com/embedded/user/play.php?v=' . $id;
             break;
         case 'facebook':
             $url = 'http://www.facebook.com/video/embed?video_id=' . $id;
             break;
         case 'twitch':
             $tw = explode('/', $id);
             $url = 'http://www.twitch.tv/' . $tw[0] . '/embed';
             if (isset($tw[1]) && isset($tw[2]) && is_numeric($tw[2])) {
                 $url = 'http://www.twitch.tv/swflibs/TwitchPlayer.swf';
                 $object_params = '<param name="movie" value="http://www.twitch.tv/swflibs/TwitchPlayer.swf">';
                 $object_params .= '<param name="allowNetworking" value="all">';
                 switch ($tw[1]) {
                     case 'b':
                     case 'c':
                     case 'v':
                         $videoid_flashvar = '&amp;videoId=' . $tw[1] . $tw[2];
                         break;
                     default:
                         return $this->error(sprintf(__('Twitch ID <code>%s</code> is invalid', $this->plugin_slug), $id));
                         break;
                 }
                 $object_params_autoplay_yes = $object_params . sprintf('<param name="flashvars" value="channel=%s%s&amp;auto_play=true">', $tw[0], $videoid_flashvar);
                 $object_params_autoplay_no = $object_params . sprintf('<param name="flashvars" value="channel=%s%s&amp;auto_play=false">', $tw[0], $videoid_flashvar);
             }
             break;
         case 'vine':
             $url = 'https://vine.co/v/' . $id . '/embed/simple';
             break;
         default:
             return $this->error(sprintf(__('Provider <code>%s</code> not valid', $this->plugin_slug), $provider));
             break;
     }
     if (!empty($object_params)) {
         $iframe = false;
         $mode = 'normal';
         if (empty($object_params_autoplay_yes)) {
             $object_params_autoplay_yes = $object_params;
             $object_params_autoplay_no = $object_params;
         }
     }
     //* Take parameters from Options as defaults and maybe merge custom parameters from shortcode in.
     //* If there are no options we assume the provider not supports any params and do nothing.
     if (!empty($this->options['params'][$provider])) {
         $parameters = wp_parse_args(preg_replace('!\\s+!', '&', trim($parameters)));
         $option_parameters = wp_parse_args(preg_replace('!\\s+!', '&', trim($this->options['params'][$provider])));
         $parameters = wp_parse_args($parameters, $option_parameters);
         $url = add_query_arg($parameters, $url);
         #d($url);
     }
     switch ($provider) {
         case 'youtube':
         case 'youtubelist':
         case 'vimeo':
         case 'dailymotion':
         case 'dailymotionlist':
         case 'viddler':
         case 'vevo':
             $url_autoplay_no = add_query_arg('autoplay', 0, $url);
             $url_autoplay_yes = add_query_arg('autoplay', 1, $url);
             break;
         case 'ustream':
             $url_autoplay_no = add_query_arg('autoplay', 'false', $url);
             $url_autoplay_yes = add_query_arg('autoplay', 'true', $url);
             break;
         case 'yahoo':
             $url_autoplay_no = add_query_arg('player_autoplay', 'false', $url);
             $url_autoplay_yes = add_query_arg('player_autoplay', 'true', $url);
             break;
         case 'metacafe':
             $url_autoplay_no = $url;
             $url_autoplay_yes = add_query_arg('ap', 1, $url);
             break;
         case 'videojug':
             $url_autoplay_no = add_query_arg('ap', 0, $url);
             $url_autoplay_yes = add_query_arg('ap', 1, $url);
             break;
         case 'blip':
         case 'bliptv':
             $url_autoplay_no = add_query_arg('autoStart', 'false', $url);
             $url_autoplay_yes = add_query_arg('autoStart', 'true', $url);
             break;
         case 'veoh':
             $url_autoplay_no = add_query_arg('videoAutoPlay', 0, $url);
             $url_autoplay_yes = add_query_arg('videoAutoPlay', 1, $url);
             break;
         case 'snotr':
             $url_autoplay_no = $url;
             $url_autoplay_yes = add_query_arg('autoplay', '', $url);
             break;
             //* Do nothing for providers that to not support autoplay or fail with parameters
         //* Do nothing for providers that to not support autoplay or fail with parameters
         case 'ign':
         case 'xtube':
         case 'collegehumor':
         case 'facebook':
         case 'twitch':
             //* uses flashvar for autoplay
             $url_autoplay_no = $url;
             $url_autoplay_yes = $url;
             break;
         case 'iframe':
         default:
             //* We are spamming all kinds of autoplay parameters here in hope of a effect
             $url_autoplay_no = add_query_arg(array('ap' => '0', 'autoplay' => '0', 'autoStart' => 'false', 'player_autoStart' => 'false'), $url);
             $url_autoplay_yes = add_query_arg(array('ap' => '1', 'autoplay' => '1', 'autoStart' => 'true', 'player_autoStart' => 'true'), $url);
             break;
     }
     if ('vimeo' == $provider && !empty($start)) {
         $url_autoplay_no .= '#t=' . $start;
         $url_autoplay_yes .= '#t=' . $start;
     }
     $thumbnail = apply_filters('arve_thumbnail', $thumbnail, array('id' => $id, 'provider' => $provider, 'mode' => $mode));
     if (is_wp_error($thumbnail)) {
         return $this->error($thumbnail->get_error_message());
     }
     // We have no thumbnail for lazyload, so treat this embed as normal
     if ('lazyload' === $mode && !$thumbnail) {
         $mode = 'normal';
     }
     $output = apply_filters('arve_output', '', array('align' => $align, 'aspect_ratio' => $aspect_ratio, 'autoplay' => $autoplay, 'grow' => $grow, 'id' => $id, 'iframe' => $iframe, 'link_text' => $link_text, 'maxwidth' => $maxwidth, 'mode' => $mode, 'object_params_autoplay_no' => $object_params_autoplay_no, 'object_params_autoplay_yes' => $object_params_autoplay_yes, 'mode' => $mode, 'provider' => $provider, 'properties' => $properties, 'provider' => $provider, 'thumbnail' => $thumbnail, 'link_text' => $link_text, 'url_autoplay_no' => $url_autoplay_no, 'url_autoplay_yes' => $url_autoplay_yes));
     if (is_wp_error($output)) {
         return $this->error($output->get_error_message());
     } elseif (empty($output)) {
         return $this->error('The output is empty, this should not happen');
     }
     if (isset($_GET['arve-debug'])) {
         static $show_options_debug = true;
         $options_dump = '';
         if ($show_options_debug) {
             ob_start();
             var_dump($this->options);
             $options_dump = sprintf('Options: <pre>%s</pre>', ob_get_clean());
         }
         $show_options_debug = false;
         ob_start();
         var_dump($atts);
         $atts_dump = sprintf('<pre>%s</pre>', ob_get_clean());
         return sprintf('<div>%s Provider: %s<br>%s<pre>%s</pre></div>%s', $options_dump, $provider, $atts_dump, esc_html($output), $output);
     }
     return $output;
 }