【问题标题】:Pause youtube video Through Javascript通过 Javascript 暂停 youtube 视频
【发布时间】:2017-04-13 09:23:37
【问题描述】:

我在对象标签中打开了 Youtube 视频网址

<object data="https://www.youtube.com/embed/a18py61_F_w?wmode=opaque&amp;rel=0&amp;autohide=1&amp;showinfo=0&amp;wmode=transparent" style="width:100%;height:100%;width: 380px; height: 214px; float: none; clear: both; margin: 2px auto;">  </object>

我想通过使用代码 javascript 代码或 jquery 代码来停止视频。

注意:我不能使用 iframe

任何帮助都会被应用。

【问题讨论】:

    标签: javascript jquery youtube


    【解决方案1】:
    <embed id="playerid" width="100%" height="100%" allowfullscreen="true" allowscriptaccess="always" quality="high" bgcolor="#000000" name="playerid" style="" src="https://www.youtube.com/embed/a18py61_F_w?wmode=opaque&amp;rel=0&amp;autohide=1&amp;showinfo=0&amp;wmode=transparent" style="width:100%;height:100%;width: 380px; height: 214px; float: none; clear: both; margin: 2px auto;" type="application/x-shockwave-flash">
    
    
    
    <a href="#" onclick="var myPlayer = document.getElementById('playerid'); myPlayer.pauseVideo();">Pause</a>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-02
      • 2013-11-20
      • 1970-01-01
      • 2017-04-11
      • 2012-11-05
      • 2017-08-16
      • 2017-07-18
      • 2011-05-16
      相关资源
      最近更新 更多