如何在移动 Safari 中播放视频

发布于 2024-11-16 23:41:36 字数 594 浏览 3 评论 0原文

我使用一个简单的 HTML5 视频标签在 iphone 浏览器中重现 mp4 视频,但它总是打开 iphone 上的视频播放器。

有没有办法在浏览器中播放视频?

<video src="http://video-js.zencoder.com/oceans-clip.mp4"
        autoplay="autoplay" <!-- Boolean attribute. Omit to prevent autoplay. -->
        start="00:00:00.00"
        loopstart="00:00:00.07" <!-- 7 seconds -->
        loopend="00:00:00.19"
        end="00:00:00.27"
        playcount="4" <!-- play 4x -->
        controls="true"
        width="640"
        height="480"
>

这是我正在使用的代码,在普通浏览器中运行良好,但在 iPhone 中它总是在视频播放器中打开。

谢谢!

I'm using a simple HTML5 video tag to reproduce an mp4 video in the iphone browser but it always open the video player on the iphone.

Is there a way to play the video inside the browser?

<video src="http://video-js.zencoder.com/oceans-clip.mp4"
        autoplay="autoplay" <!-- Boolean attribute. Omit to prevent autoplay. -->
        start="00:00:00.00"
        loopstart="00:00:00.07" <!-- 7 seconds -->
        loopend="00:00:00.19"
        end="00:00:00.27"
        playcount="4" <!-- play 4x -->
        controls="true"
        width="640"
        height="480"
>

This is my code I'm using, and works well in a normal browser but in the iphone it allways opens in the video player.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

郁金香雨 2024-11-23 23:41:36

据我所知,iPhone 总是在本机播放器中打开 HTML5 视频(以避免邮票大小的视频)。 iPad 可以使用相同的代码在 Safari 中播放它。我不相信有办法克服这个问题。

To the best of my knowledge, iPhones always open HTML5 video in the native player (to avoid postage-stamp sized videos). iPads will play it within Safari using the same code. I don't believe there's a way to override this.

遥远的她 2024-11-23 23:41:36

使用playsinline
<视频…内联播放/>

Use playsinline
<video … playsinline />

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文