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 --- video_formatter.inc | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'video_formatter.inc') 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