【问题标题】:To run a flv file without loop无循环运行 flv 文件
【发布时间】:2023-03-11 03:08:02
【问题描述】:

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

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

【问题讨论】:

    标签: html flv flash-video


    【解决方案1】:

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

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

    有关“flashvars”参数的更多详细信息over here.

    【讨论】:

    • 我在我的代码中添加了 repeat:"none",但它不起作用。
    • 尝试重新加载浏览器或清除缓存。 Flash 在这种情况下非常持久。
    • 嗨,JakeGould,我清除了我的 cookie,但仍然循环播放
    猜你喜欢
    • 1970-01-01
    • 2016-06-30
    • 2012-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-16
    • 1970-01-01
    • 2021-12-23
    相关资源
    最近更新 更多