diff -urpN media_youtube.old/includes/media_youtube.admin.inc media_youtube/includes/media_youtube.admin.inc --- media_youtube.old/includes/media_youtube.admin.inc 2010-10-10 19:39:30.000000000 +0200 +++ media_youtube/includes/media_youtube.admin.inc 2011-01-27 17:05:06.000000000 +0100 @@ -118,6 +118,13 @@ function media_youtube_admin_form() { '#description' => t("If checked, additional info, such as title and rating, will NOT be displayed on the YouTube player."), ); + $form['player']['player_options'][media_youtube_variable_name('html5_player')] = array( + '#type' => 'checkbox', + '#title' => t('Use the HTML5 player instead of the Flash-based'), + '#default_value' => media_youtube_variable_get('html5_player'), + '#description' => t("If checked, the HTML5 capable player will be used instead of the regular flash-based. This is achieved as an iframe."), + ); + $form['player']['jwflv'] = array( '#type' => 'fieldset', '#title' => t('JW FLV Media Player Options'), diff -urpN media_youtube.old/media_youtube.module media_youtube/media_youtube.module --- media_youtube.old/media_youtube.module 2010-11-12 16:58:57.000000000 +0100 +++ media_youtube/media_youtube.module 2011-01-27 17:15:45.000000000 +0100 @@ -60,6 +60,12 @@ function media_youtube_theme($existing, 'file' => 'media_youtube.theme.inc', 'template' => 'media-youtube-flash', ), + 'media_youtube_html5' => array( + 'arguments' => array('variables' => array()), + 'path' => $path .'/themes', + 'file' => 'media_youtube.theme.inc', + 'template' => 'media-youtube-html5', + ), 'media_youtube_default_external' => array( 'arguments' => array('variables' => array()), 'path' => $path .'/themes', diff -urpN media_youtube.old/providers/emvideo/youtube.inc media_youtube/providers/emvideo/youtube.inc --- media_youtube.old/providers/emvideo/youtube.inc 2010-11-12 16:58:57.000000000 +0100 +++ media_youtube/providers/emvideo/youtube.inc 2011-01-31 13:04:35.000000000 +0100 @@ -275,7 +275,12 @@ function emvideo_youtube_video($video_id $options['item'] = isset($options['item']) ? $options['item'] : $item; $options['node'] = isset($options['node']) ? $options['node'] : $node; $options['autoplay'] = isset($options['autoplay']) ? $options['autoplay'] : $autoplay; - $output = theme('media_youtube_flash', $options); + $html5_instead_of_flash = media_youtube_variable_get('html5_player'); + if ($html5_instead_of_flash) { + $output = theme('media_youtube_html5', $options); + } else { + $output = theme('media_youtube_flash', $options); + } return $output; } diff -urpN media_youtube.old/themes/media-youtube-html5.tpl.php media_youtube/themes/media-youtube-html5.tpl.php --- media_youtube.old/themes/media-youtube-html5.tpl.php 1970-01-01 01:00:00.000000000 +0100 +++ media_youtube/themes/media-youtube-html5.tpl.php 2011-01-31 11:31:10.000000000 +0100 @@ -0,0 +1,13 @@ + + \ No newline at end of file diff -urpN media_youtube.old/themes/media_youtube.theme.inc media_youtube/themes/media_youtube.theme.inc --- media_youtube.old/themes/media_youtube.theme.inc 2010-11-12 16:58:57.000000000 +0100 +++ media_youtube/themes/media_youtube.theme.inc 2011-01-31 11:37:07.000000000 +0100 @@ -30,6 +30,18 @@ function theme_media_youtube_video_uploa return "
$message
"; } +function template_preprocess_media_youtube_html5(&$variables) { + // Merge in our default variables. + $variables = array_merge($variables, $variables['variables']); + + $video_id = $variables['video_id']; + $variables['url'] = isset($variables['url']) ? $variables['url'] : "http://www.youtube.com/v/$video_id"; + $variables['url'] = check_plain($variables['url']); + $variables['width'] = check_plain($variables['width']); + $variables['height'] = check_plain($variables['height']); + $variables['fullscreen_value'] = check_plain($variables['fullscreen_value']); +} + function template_preprocess_media_youtube_default_external(&$variables) { // Merge in our default variables. $variables = array_merge($variables, $variables['variables']);