0

我是运行.flv文件的新手。我为此使用了一个教程。教程链接http://www.fieg.nl/embed-html5-video-with-flash-fallback#file-index.html

在这里,视频文件不时重复。我认为这是一个循环。打开窗口时视频文件如何运行一次。运行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>        
4

1 回答 1

0

看起来您正在使用 JW Player,对吗?然后你应该添加repeat: none到 flashvars,让它看起来像这样。

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

有关“flashvars”参数的更多详细信息请点击此处。

于 2013-01-22T21:00:20.650 回答