问题描述
我已经为Google搜索了一段时间,以获取该问题的答案.
I've serach google for a while to get an answer to this question.
我想用JavaScript构建一个既有图像又有我自己的SWF电影的滑块.问题是我希望此滑块自动滑动,当它碰到SWF电影时,我应该自动播放,当电影结束时继续滑动.当然,我希望它循环播放.
I want to build a slider with JavaScript that both have images and my own SWF movies.The problem is that i want this slider to slide automatic and when it hits a SWF movie i should play that automatic and when the movie ends continue with the slide.And ofcourse i want it to loop.
我需要一个正确的方向来找到示例和帮助.
I need a finger in the right direction where to find examples and help.
问候埃里克
推荐答案
我建议使用SWFObject插件(http://code.google.com/p/swfobject/)和JW Player(http://www.JF Player). longtailvideo.com/players/jw-flv-player/).如果只是电影,FLV可能是更好的格式.
I would recommend using SWFObject plugin (http://code.google.com/p/swfobject/), and JW Player (http://www.longtailvideo.com/players/jw-flv-player/). If it's just a movie, FLV might be a better format.
在应加载页面的情况下,您需要执行$ .ajax请求以获取相应文件的flashvars.在您的Flashvar中,您需要创建div来附加视频播放器,并确保将自动启动"设置为true.
On the event that your page should load, you need to do a $.ajax request to get the flashvars for the appropriate file. In your flashvars, you need to create the div to have your video player appended to, and make sure 'autostart' is set to true.
$.ajax({
url: '/path/to/flashvars.js',
dataType: 'script',
cache: false
});
要使用滑块进行设置,请尝试将其与jCarousel集成.那应该做.
To set it up with a slider, try integrating it with jCarousel. That should do it.
这篇关于jQuery滑杆,滑至时自动播放SWF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!