使用 Flowplayer 自动重复或如何在 javascript 中将回调作为字符串传递
我在 html 页面上有一个嵌入式 Flash 视频播放器, 像这样的:
<embed id="flash-videojs-31-field-mech"
name="flash-videojs-31-field-mech"
src="http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf"
width="320"
height="240"
type="application/x-shockwave-flash"
allowscriptaccess='always'
allowfullscreen='true'
flashvars="config={'playlist': [ {'url': 'http://example.com/president.mp4', 'autoPlay':true, 'autoBuffering':true} ]}"
/>
现在我需要添加自动重复功能。我找到了这个解决方案: http://flowplayer.org/forum/3/20130
不幸的是,它涉及传递函数对象,我很难将其插入到 flashvars 属性中。
我不能按原样接受它,因为 html 片段实际上是由第三方代码生成的,我希望将调整次数保持在最低限度。
I have an embedded flash video player on html page,
something like this:
<embed id="flash-videojs-31-field-mech"
name="flash-videojs-31-field-mech"
src="http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf"
width="320"
height="240"
type="application/x-shockwave-flash"
allowscriptaccess='always'
allowfullscreen='true'
flashvars="config={'playlist': [ {'url': 'http://example.com/president.mp4', 'autoPlay':true, 'autoBuffering':true} ]}"
/>
Now I need to add an auto repeat functionality. I found this solution: http://flowplayer.org/forum/3/20130
Unfortunately, it involves passing function objects around and I have difficulties inserting it into flashvars attribute.
I can't take it as is, cause html snippet is actually generated by third party code and I want to keep number of tweaks minimal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是 flowplayer,那么您可以在嵌入完成后对其进行修改。
尝试使用他们的 API 并执行以下操作:
这应该为页面上的所有玩家启用自动重复。您还可以使用过滤器来选择您需要的玩家。
If you're using flowplayer, then you possibly can modify it after the embed is done.
Try using their API and doing something like:
This should enable autorepeat for all players on your page. You may also use filter to select the players you need.