2013-01-22 50 views
0

我是新來運行一個.flv文件。我爲此使用了一個教程。本教程的鏈接http://www.fieg.nl/embed-html5-video-with-flash-fallback#file-index.html要運行一個沒有循環的flv文件

這裏的視頻文件正在重複時常。我認爲這是一個循環。視頻文件在打開窗口時如何運行一次。下面是運行flv文件的代碼。

<script type="text/javascript"> 
      jQuery(document).ready(function() { 
       var v = document.createElement("video"); // Check if the browser supports the video tag 
       if (!v.play) { // If no, use Flash. 
         var params = { 
          allowfullscreen: "false", 
          allowscriptaccess: "always", 
          wmode: "transparent" 
         }; 

         var flashvars = { 
          src: "demo.flv" 
         }; 

         swfobject.embedSWF("http://localhost/TantraProjects/Ranjit/html5/demo_flv.SWF", "demo-video-flash", "270", "296", "9.0.0", "http://localhost/TantraProjects/Ranjit/html5/expressInstall.swf", flashvars, params); 
       } 
       else { 
         // fix for firefox not looping 
         var myVideo = document.getElementById('demo-video'); 

         if ((typeof myVideo.loop == 'boolean')) { // loop supported 
          myVideo.addEventListener('ended', function() { 
            this.currentTime = 0; 
            this.play(); 
          }, false); 
         } 
       } 
      }); 
</script> 

請幫助我更多地瞭解它。

嗨,我對視頻有同樣的看法。視頻中有一個循環,我不想循環播放視頻。我的代碼爲html。

<div id="demo-video-flash"><!-- wrapped in a div for the flash fallback --> 
    <video id="demo-video" height="155" width="270" autoplay loop> 
     <source src="http://localhost/TantraProjects/Ranjit/html5/demo.mp4" type="video/mp4" /> <!-- MPEG4 for Safari --> 
     <source src="http://localhost/TantraProjects/Ranjit/html5/demo.ogv" type="video/ogg" /> <!-- Ogg Theora for Firefox 3.1b2 --> 

     <!-- this is the image fallback in case flash is not support either --> 
     <img src="http://localhost/TantraProjects/Ranjit/html5/demoo.png"/> 
    </video> 
</div>   

回答

0

看起來你正在使用JW Player,對嗎?然後,你應該添加repeat: none到flashvars,所以它看起來像這樣。

var flashvars = { 
     src: "demo.flv", 
     repeat: "none" 
}; 

的更多細節的「Flash變量」 PARAMS over here.

+0

我已經加入了重複:「無」到我的代碼,但沒有奏效。 – Ranjit

+0

嘗試重新加載瀏覽器或清除緩存。 Flash非常堅持這種方式。 – JakeGould

+0

嗨JakeGould我清理了我的cookie,但仍然收到了循環 – Ranjit