如何在 HTML 中嵌入 .mov 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12521849/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:55:52  来源:igfitidea点击:

How to embed a .mov file in HTML?

html.mov

提问by Charles Marsh

What's the correct way of adding a .movfile to a webpage?

.mov文件添加到网页的正确方法是什么?

I'm just adding this functionality to an existing file so I can't convert it to HTML5. The file is on the same server about 1G in size.

我只是将此功能添加到现有文件中,因此无法将其转换为 HTML5。该文件位于同一台服务器上,大小约为 1G。

The client also doesn't want to use YouTube or Vimeo as it's on the homepage.

客户也不希望使用主页上的 YouTube 或 Vimeo。

回答by BadPirate

Had issues using the code in the answer provided by @haynar above (wouldn't play on Chrome), and it seems that one of the more modern ways to ensure it plays is to use the video tag

使用上面@haynar 提供的答案中的代码时遇到问题(不会在 Chrome 上播放),似乎确保播放的更现代方法之一是使用视频标签

Example:

例子:

<video controls="controls" width="800" height="600" 
       name="Video Name" src="http://www.myserver.com/myvideo.mov"></video>

This worked like a champ for my .mov file (generated from Keynote) in both Safari and Chrome, and is listed as supported in most modern browsers (The video tag is supported in Internet Explorer 9+, Firefox, Opera, Chrome, and Safari.)

这在 Safari 和 Chrome 中就像我的 .mov 文件(从 Keynote 生成)的冠军一样,并且在大多数现代浏览器中被列为支持(视频标签在 Internet Explorer 9+、Firefox、Opera、Chrome 和 Safari 中受支持.)

Note: Will work in IE / etc.. if you use MP4 (Mov is not officially supported by those guys)

注意:如果您使用 MP4,将在 IE / 等中工作(这些人不正式支持 Mov)

回答by haynar

<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
    <param name="src" value="sample.mov">
    <param name="qtsrc" value="rtsp://realmedia.uic.edu/itl/ecampb5/demo_broad.mov">
    <param name="autoplay" value="true">
    <param name="loop" value="false">
    <param name="controller" value="true">
    <embed src="sample.mov" qtsrc="rtsp://realmedia.uic.edu/itl/ecampb5/demo_broad.mov" width="320" height="256" autoplay="true" loop="false" controller="true" pluginspage="http://www.apple.com/quicktime/"></embed>
</object>

sourceis the first search resultof the Google

是第一个搜索结果中的谷歌

回答by Tieson T.

Well, if you don't want to do the work yourself (objectelements aren't really all that hard), you could always use Mike Alsup's Media plugin: http://jquery.malsup.com/media/

好吧,如果你不想自己做这项工作(object元素并不是那么难),你可以随时使用 Mike Alsup 的媒体插件:http: //jquery.malsup.com/media/