【问题标题】:How can I use jQuery/javascript to play a full screen video on mobile using the native player from the browser?如何使用 jQuery/javascript 使用浏览器中的本机播放器在移动设备上播放全屏视频?
【发布时间】:2015-07-12 02:31:12
【问题描述】:

单击按钮时,我试图让我的视频在用户的手机上播放。我尝试过使用绝对定位元素,但它没有播放。如何使用jQuery或javascript点击播放视频?

编辑 该视频只是我拥有的本地视频。

<video>
   <source url="mysite.com/example.mp4" type="video/mp4">
</video>

【问题讨论】:

    标签: javascript html video mobile html5-video


    【解决方案1】:

    您没有指定链接到视频的元素类型。如果是 iframe,请使用 allowfullscreen

      <iframe src="http://player.example.com" width="560" height="315" frameborder="0" allowfullscreen></iframe>
    

    如果您使用 HTML5 视频标签,则必须使用 requestFullscreen 方法,根据 full screen specifications

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-04-20
      • 2011-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-28
      • 1970-01-01
      相关资源
      最近更新 更多