如何使用flowplayer模块为电影添加字幕?

时间:2010-12-06 16:31:57

标签: drupal flowplayer

我正在使用flowplayer模块在我的网站上播放视频。我想在一些电影中加入sutitles。我怎么能在Drupal中做到这一点? 我试着像这样添加它们:

$flowplayer = array(
'clip' => array(
    'url' => str_replace('sites/default/files/videos', 'http://www.mysite.com/sites/default/files/videos', $node->field_video[0]['filepath']),
    'captionURL' => str_replace('sites/default/files/videos', 'http://www.mysite.com/sites/default/files/videos', $node->field_caption[0]['filepath'])

),
....

然后输出是:

<param value="config={"clip":{"url":"http://www.mysite.com/sites/default/files/videos/video.flv","captionURL":"http://www.mysite.com/sites/default/files/videos/subtitles.srt","scaling":"fit"},...

然而它说没有发现流。当我删除“剪辑”时,会找到视频。但是我该如何添加字幕? 我想知道我的代码是否需要插件或错误?

感谢。

1 个答案:

答案 0 :(得分:0)

您是否会有多个视频?您可以尝试使用支持标题的播放列表参数。我不确定你会如何显示它们(我现在正在做一些非常相似的事情,希望这很有帮助)。我正在使用Flowplayer API模块,但js语法应该类似。

$player = theme('flowplayer',array(
                                    'clip' => array(
                                        'duration' => 5,
                                        'autoPlay' => true
                                    ),
                                    'playlist' => array(
                                        array('url' =>'http://localhost/episode_18.mp4','title' => 'Episode 18'),
                                        array('url' =>'http://localhost/episode_19.mp4','title' => 'Episode 19'),
                                        array('url' =>'http://localhost/6.jpg','title' => 'Image')
                                ),
                                'plugins' => array(
                                        'controls' => array(
                                            'playlist' => true
                                        )
                                    )
                                )
                            );
    return $player;