如何设置视频在 Windows、Mac、Android 和 iOS 设备上的所有主要浏览器上播放

发布于 2024-09-28 17:17:51 字数 99 浏览 1 评论 0原文

我们需要制作某些产品的视频演示。确保视频在所有流行平台上尽可能多的浏览器上播放的最佳方法是什么?

目前的实现:我们只有在 Flash 播放器中加载的 Flash 视频。

We have a requirement to create a video demo of certain products. What is the best way to make sure that the video plays on as many browsers as possible on all popular platforms?

Current implementation: we just have Flash videos that load in a Flash player.

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

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

发布评论

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

评论(3

┼── 2024-10-05 17:17:51

如果托管服务对您来说是一个可行的选择,Vimeo 和 Wistia 等网站的付费帐户将为桌面浏览器提供 Flash 视频,为智能手机和其他移动设备(如 iPad 和即将推出的三星、黑莓等平板电脑)提供 HTML5 视频

。您将自己完成所有托管工作,我建议使用 HTML5 视频标签,并简单地回退到 Flash。优秀的 VideoJS 脚本可以为您处理大部分困难的事情,甚至允许您构建自定义嵌入代码

基本上,HTML 看起来像这样:

<video width="640" height="360" poster="poster.png" controls preload>
    <source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> <!-- This video file is for Safari, Chrome and smartphones running iOS and Android, it will also be referenced later in the Flash fallback for Internet Explorer -->
    <source src="video.ogv" type='video/ogg; codecs="theora, vorbis"' /> <!-- This video file is for Firefox, Opera, and is also supported by Chrome -->

    <object id="flash_fallback" width="640" height="360" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"> <!-- This calls on FlowPlayer, an excellent third party Flash video player -->
        <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
        <param name="allowfullscreen" value="true" />
        <param name="flashvars" value='config={"playlist":["poster.png", {"url": "video.mp4","autoPlay":false,"autoBuffering":true}]}' /> <!-- Notice here you're calling the same .mp4 file as above -->
        <img src="poster.png" width="640" height="360" alt="Poster Image" title="No video playback capabilities." /> <!-- If the browser can't handle any of the HTML5 video files and doesn't have Flash installed, they'll just get the poster frame as shown here -->
    </object>
</video>

希望这有帮助!

If a hosted service is a viable option for you, paid accounts at sites like Vimeo and Wistia will serve Flash video to desktop browsers and HTML5 video for smartphones and other mobile devices like the iPad and upcoming tablets from Samsung, Blackberry, etc.

If you'll be doing all of the hosting yourself, I recommend using the HTML5 video tag with a simple fallback to Flash. The excellent VideoJS script handles most of the hard stuff for you and even allows you to build custom embed codes.

Basically, the HTML would look like this:

<video width="640" height="360" poster="poster.png" controls preload>
    <source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> <!-- This video file is for Safari, Chrome and smartphones running iOS and Android, it will also be referenced later in the Flash fallback for Internet Explorer -->
    <source src="video.ogv" type='video/ogg; codecs="theora, vorbis"' /> <!-- This video file is for Firefox, Opera, and is also supported by Chrome -->

    <object id="flash_fallback" width="640" height="360" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"> <!-- This calls on FlowPlayer, an excellent third party Flash video player -->
        <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
        <param name="allowfullscreen" value="true" />
        <param name="flashvars" value='config={"playlist":["poster.png", {"url": "video.mp4","autoPlay":false,"autoBuffering":true}]}' /> <!-- Notice here you're calling the same .mp4 file as above -->
        <img src="poster.png" width="640" height="360" alt="Poster Image" title="No video playback capabilities." /> <!-- If the browser can't handle any of the HTML5 video files and doesn't have Flash installed, they'll just get the poster frame as shown here -->
    </object>
</video>

Hope this helps!

枕头说它不想醒 2024-10-05 17:17:51

Flash 无法在任何 iOS 设备上播放。

编辑:我读错了问题。如果您使用 youtube 托管视频并嵌入 youtube 视频,则可以通过 youtube 应用在 iOS 设备上播放该视频。这将是一种方法。

Flash would not be playable on any iOS devices.

Edit: I misread the question. If you use youtube to host the video and embed a youtube video, you can then play the video on an iOS device through the youtube app. That would be one way to do it.

清风无影 2024-10-05 17:17:51

在您的网站页面上使用可回退到 HTML5 版本的嵌入式视频播放器(例如 JWPlayer)。这样,您就可以在所有浏览器上使用 Flash 实现可预测/稳定的播放,并在支持 Flash 的设备(Android、iOS 等)上实现 HTML5 播放。

Use embeddable video players that have fallback to HTML5 versions on your website page (eg, JWPlayer). That way you'll get predictable/stable playback using Flash on all browsers, and HTML5 playback on devices that support it (Android, iOS, others).

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