jQuery带视频播器放功能焦点图轮播特效
同时支持视频和图片的焦点图,本例用到了flash
XML/HTML Code
- <center>
- <div class="royalSlider rsMinW">
- <div class="rsContent"> <a class="rsImg" data-rsVideo="movies/jgpearslogo.mp4" href="images/afsdf.jpg"></a> </div>
- <div class="rsContent"> <a class="rsImg" data-rsVideo="movies/jgpearslogo.mp4" href="images/asdf1235.jpg"></a> </div>
- <div class="rsContent"> <img src="images/fff.png" /> </div>
- </div>
- </center>
JavaScript Code
- <script type="text/javascript">
- var slider = $('.royalSlider').royalSlider({
- // options...
- keyboardNavEnabled: true,
- navigateByClick: false,
- sliderDrag: false,
- imageScaleMode: 'fill'
- }).data('royalSlider');
- slider.ev.on('rsOnCreateVideoElement', function(e, url)
- {
- // url - path to video from data-rsVideo attribute
- // slider.videoObj - jQuery object that holds video HTML code
- // slider.videoObj must be IFRAME, VIDEO or EMBED element, or have class rsVideoObj
- slider.videoObj = $('<div id="mediaplayer" class="rsVideoObj">Loading the player ...</div>');
- setTimeout(function() {
- jwplayer('mediaplayer').setup({
- 'flashplayer': 'jwplayer/player.swf',
- 'id': 'playerID',
- 'width': '100%',
- 'height': '100%',
- "autoplay": true,
- 'file': url,
- 'viral.onpause': false,
- 'controlbar.idlehide':true,
- 'stretching': 'exactfit',
- });
- }, 50);
- });
- </script>
原文地址:http://www.freejs.net/article_jiaodiantu_753.html