From 797aef53344791c484e5568a1a4a639301ed262f Mon Sep 17 00:00:00 2001 From: Heshan Date: Fri, 18 Mar 2011 14:27:47 +0530 Subject: Flowplayer support with Flash play --- includes/video_helper.inc | 2 +- theme/video-play-flv.tpl.php | 9 +++++---- theme/video-play-html5.tpl.php | 4 ++-- video_formatter.inc | 16 +++++----------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/includes/video_helper.inc b/includes/video_helper.inc index 63d6f61..9f3ae2e 100644 --- a/includes/video_helper.inc +++ b/includes/video_helper.inc @@ -49,7 +49,7 @@ class video_helper { $video->player_height = trim($player_dimensions[1]); // load thumbnail object $video->thumbnail = $this->thumbnail_object($variables); -// $video->formatter = $variables['#formatter']; + $video->formatter = $variables['instance']['display']['default']['type']; $video->autoplay = variable_get('video_autoplay', FALSE); $video->autobuffering = variable_get('video_autobuffering', TRUE); $video->theora_player = variable_get('video_ogg_player', 'http://theora.org/cortado.jar'); diff --git a/theme/video-play-flv.tpl.php b/theme/video-play-flv.tpl.php index c895c8d..418fec2 100644 --- a/theme/video-play-flv.tpl.php +++ b/theme/video-play-flv.tpl.php @@ -1,13 +1,14 @@ -themed_output); ?> \ No newline at end of file diff --git a/theme/video-play-html5.tpl.php b/theme/video-play-html5.tpl.php index cb4d51a..62a474e 100644 --- a/theme/video-play-html5.tpl.php +++ b/theme/video-play-html5.tpl.php @@ -26,7 +26,7 @@ "; ?> - + - + $video)); ?> \ No newline at end of file diff --git a/video_formatter.inc b/video_formatter.inc index 0be14f8..f29edd4 100644 --- a/video_formatter.inc +++ b/video_formatter.inc @@ -162,7 +162,8 @@ function theme_video_encoding_failed() { return '
' . t('The video conversion process has failed. You might want to submit a simpler video format like mpeg or divx avi.
If the problem persists please contact website administrators.') . '
'; } -function theme_video_flv($video, $node) { +function theme_video_flv($video) { + $video = (object) $video; if ($video->flash_player == 'swftools') { $options = array( 'params' => array( @@ -177,7 +178,7 @@ function theme_video_flv($video, $node) { $themed_output = swf($video->files->{$video->player}->url, $options); } elseif ($video->flash_player == 'flowplayer') { // kjh: use a playlist to display the thumbnail if not auto playing - if (!$video->autoplay && $video->thumbnail->url) { + if (isset($video->autoplay) && isset($video->thumbnail->url)) { $options = array( 'playlist' => array($video->thumbnail->url, array('url' => urlencode($video->files->{$video->player}->url), @@ -191,18 +192,11 @@ function theme_video_flv($video, $node) { 'autoBuffering' => $video->autobuffering, ),); } - - $themed_output = theme( - 'flowplayer', - $options, - $video->formatter, - // adding 24px to height #973636 - array('style' => 'width:' . $video->player_width . 'px;height:' . ($video->player_height + 24) . 'px;') - ); + $themed_output = theme('flowplayer', array('config' => $options, 'id' => 'flowplayer-' . $video->formatter, 'attributes' => array('style' => 'width:' . $video->player_width . 'px;height:' . ($video->player_height + 24) . 'px;'))); } else { $themed_output = t('No flash player has been setup. ' . l(t('Please select a player to play Flash videos.'), 'admin/settings/video/players')); } - return theme('video_play_flv', $video, $node, $themed_output); + return theme('video_play_flv', array('video' => $video, 'themed_output' => $themed_output)); } /** -- cgit v1.2.3