From b27247c41d422c9143b579a3854c7ac1210ce291 Mon Sep 17 00:00:00 2001 From: "Adam J. DiCarlo" Date: Tue, 11 Sep 2012 19:26:46 -0700 Subject: [PATCH] Issue #1111074: Display videos in HTML5 for non Flash-enabled browsers. --- themes/media-brightcove-video.tpl.php | 2 +- themes/media_brightcove.theme.inc | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/themes/media-brightcove-video.tpl.php b/themes/media-brightcove-video.tpl.php index 3937bae..1c742e4 100644 --- a/themes/media-brightcove-video.tpl.php +++ b/themes/media-brightcove-video.tpl.php @@ -20,4 +20,4 @@ * $options // Various option overrides passed to the theme. */ ?> -
\ No newline at end of file +
\ No newline at end of file diff --git a/themes/media_brightcove.theme.inc b/themes/media_brightcove.theme.inc index d3b9688..e0c17ac 100644 --- a/themes/media_brightcove.theme.inc +++ b/themes/media_brightcove.theme.inc @@ -30,6 +30,11 @@ function template_preprocess_media_brightcove_video(&$variables) { static $count = 0; if ($variables['video_id']) { + if ($count === 0) { + drupal_set_html_head(''); + drupal_set_html_head(''); + } + $variables['width'] = !empty($variables['width']) ? $variables['width'] : (!empty($variables['options']['width']) ? $variables['options']['width'] : media_brightcove_variable_get('default_width')); $variables['height'] = !empty($variables['height']) ? $variables['height'] : (!empty($variables['options']['height']) ? $variables['options']['height'] : media_brightcove_variable_get('default_height')); @@ -49,7 +54,7 @@ function template_preprocess_media_brightcove_video(&$variables) { $variables['player_id'] = check_plain($player_id); $variables['video_id'] = check_plain($variables['video_id']); - $variables['object_id'] = 'media-brightcove-video-'. ($count++); + $variables['object_id'] = 'myExperience'. $variables['video_id']; $variables['div_id'] = 'media-brightcove-'. ($count++); $variables['classes'] = array('media-brightcove'); $variables['availability'] = TRUE; @@ -82,8 +87,22 @@ function template_preprocess_media_brightcove_video(&$variables) { else { // @TODO: Tie this in. $autostart = $variables['options']['autoplay'] ? 'autoStart=true' : 'autoStart=false'; + $variables['secure'] = $_SERVER['HTTPS'] == 'on' ? 'true' : 'false'; $variables['output'] = << + + + + + + + + + + + + + + OUTPUT; } } -- 1.7.8