【问题标题】:Turning off autoplay on Vimeo video that is set at a specific time to play关闭在特定时间播放的 Vimeo 视频的自动播放
【发布时间】:2015-07-03 10:40:07
【问题描述】:

我会在第一轮中尽可能全面地回答我的问题。我的问题是这样的:

我正在尝试将 Vimeo 视频嵌入到 Blogger 中,该视频以特定时间戳(即 4 分 32 秒)播放,而不是在没有自动播放的情况下播放视频的开头。该视频将在时间戳处很好地嵌入,但它会自动播放,我无法弄清楚如何关闭该功能。视频代码如下:

<div style="text-align: center;">
<br />
<iframe allowfullscreen="" frameborder="0" height="375" mozallowfullscreen=""src="https://player.vimeo.com/video/125840111#t=3665s" webkitallowfullscreen=""width="500"></iframe>

我尝试了各种方法“?autoplay=0”等,但我想我没有得到正确的代码。

任何帮助将不胜感激

【问题讨论】:

    标签: embed blogger vimeo autoplay


    【解决方案1】:

    你试过这样吗?

    <iframe allowfullscreen="" frameborder="0" height="375" mozallowfullscreen=""src="https://player.vimeo.com/video/125840111#t=3665s?autoplay=0" webkitallowfullscreen=""width="500"></iframe>
    

    如果它不起作用然后尝试通过inspect元素找到它,它可能会在页面加载后更改为?autopplay=1, 所以试试这个对我有用的方法

    首先您的html,将您的vimeo视频的屏幕截图粘贴到图像标签中并为此定义一个onclick函数并在click函数上绑定iframe,它应该可以工作 这是代码

    <div id="parent-div" >                                                                   
      <img id="vimeo-video" src="images/homeVideo.png" onclick="return imgClick();" />
      </div>   
    

    还有你的javascript函数

    function imgClick() {
    
                        jQuery('#image-for-video').hide();  //hide the image to display your video
                        var ifrm = document.createElement("iframe");
                        ifrm.setAttribute("src", "https://player.vimeo.com/video/1992892829?autoplay=0");
                        ifrm.style.width = "496px";
                        ifrm.style.height = "277px";
                        // add rest of your values
                        ifrm.frameborder = 0;
                        document.getElementById("parent-div").appendChild(ifrm);
                        return false;
                    }
    

    【讨论】:

    • autoplay0 的东西在 2018 年的 Firefox 中不起作用 :( 还有其他方法吗?
    猜你喜欢
    • 1970-01-01
    • 2016-03-16
    • 1970-01-01
    • 2014-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-13
    • 2012-02-20
    相关资源
    最近更新 更多