2013-08-22 107 views
0

video.js你好。我試圖在滑塊啓動時自動播放視頻。這部分工作。問題發生時,雖然它循環播放,並回到視頻,視頻不會重播。我試圖找出一個循環=「真」,但如果我這樣做,它只是反覆播放視頻,然後滑塊不起作用。有什麼建議?謝謝! (如果需要的話我可以加我的代碼)視頻播放滑塊

<meta charset="utf-8"> 

<title>AnythingSlider Video Demo</title> 
<link rel="shortcut icon" href="demos/images/favicon.ico" type="image/x-icon"> 
<link rel="apple-touch-icon" href="demos/images/apple-touch-icon.png"> 

<!-- jQuery (required) --> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> 
<script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script> 

<!-- Demo stuff --> 

<link rel="stylesheet" href="demos/css/page.css"> 

<!-- Anything Slider optional plugins, but needed so the embeded video controls will work in IE --> 
<!-- http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js --> 
<script src="js/swfobject.js"></script> 

<!-- Anything Slider --> 
<link href="video-js.css" rel="stylesheet" type="text/css"> 

<link rel="stylesheet" href="css/anythingslider.css"> 
<script src="js/jquery.anythingslider.js"></script> 

<!-- AnythingSlider video extension; optional, but needed to control video pause/play --> 
<script src="js/jquery.anythingslider.video.js"></script> 

<script> 
// DOM Ready 
$(function(){ 
$('#slider') 
.anythingSlider({ 
resizeContents  : true, 
autoPlay   : true, 
addWmodeToObject : 'opaque', 
buildStartStop: false, 
navigationFormatter : function(index, panel){ // Format navigation labels with text 
return [][index - 1]; 

} 
}) 


// Initialize video extension 

// see https://developers.google.com/youtube /player_parameters?hl=en#Parameters for a list of parameters 

.anythingSliderVideo({ 
startPanel   : 1, 
// video id prefix; suffix from  
$.fn.anythingSliderVideo.videoIndex 
videoId : 'asvideo', 
// auto load YouTube api script 
youtubeAutoLoad : false, 
wmode: 'transparent&autoplay=1', // (hack) add autoplay code here 
// see: https://developers.google.com/youtube /player_parameters#Parameters 
youtubeParams: { 
modestbranding : 1, 
iv_load_policy : 3,  
fs : 1 
} 
}); 
}); 
</script> 
<script src="video.js"></script> 

<!-- Unless using the CDN hosted version, update the URL to the Flash SWF --> 

<script> 
videojs.options.flash.swf = "video-js.swf"; 
</script> 
</head> 

<body> 

<!-- START AnythingSlider --> 
<ul id="slider">  

<!-- HTML5 Video --> 
<li class="panel5"> 
<video id="example_video_1" class="video-js vjs-default-skin" controls autoplay preload="auto" autoplay="true" width="640" height="264" 
poster="http://video-js.zencoder.com/oceans-clip.png" 
data-setup="{}"> 
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' /> 
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' /> 
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' /> 
<track kind="captions" src="demo.captions.vtt" srclang="en" label="English">  
</track><!-- Tracks need an ending tag thanks to IE9 --> 
</video> 
</li> 
<li><img src="demos/images/slide-civil-1.jpg" alt=""></li> 

<li><img src="demos/images/slide-env-1.jpg" alt=""></li> 

<li><img src="demos/images/slide-civil-2.jpg" alt=""></li> 

<li><img src="demos/images/slide-env-2.jpg" alt=""></li> 

</ul> <!-- END AnythingSlider --> 

<br> 

</div> 

<br> 
+0

請添加代碼,因爲它會更容易幫助你。 –

+0

將其添加到您的問題中,不在評論中。編輯你的問題,並複製代碼並對其進行格式化:http://stackoverflow.com/help/formatting –

+0

嗨喬納森。有任何想法嗎? –

回答

1

您可以將<video>標籤的自動播放參數添加到「自動播放」,而不是真實的。這對我使用任何滑塊工作。