这个不算啥奇特吧?但還是纪录1下。
这个难题应当这么看。
1、最先网站要适用.MOV文件格式文档
便是说,网站要能鉴别.MOV文件格式文档。
<mimeMap fileExtension=".mov" mimeType="video/quicktime" />
怎样鉴别?设定MIME种类。以IIS为例。除能够在IIS页面上立即设定,还能够在新项目的web.config里设定。给个详细的事例
<?xml version="1.0" encoding="UTF⑻"?> <configuration> <system.webServer> <directoryBrowse enabled="true" /> <defaultDocument> <files> <remove value="default.aspx" /> <remove value="iisstart.htm" /> <remove value="index.html" /> <remove value="index.htm" /> <remove value="Default.asp" /> <remove value="Default.htm" /> </files> </defaultDocument> <staticContent> <remove fileExtension=".mp4" /> <remove fileExtension=".wasm" /> <remove fileExtension=".woff" /> <remove fileExtension=".woff2" /> <remove fileExtension=".mov" /> <mimeMap fileExtension=".mp4" mimeType="video/mpeg" /> <mimeMap fileExtension=".wasm" mimeType="application/wasm" /> <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" /> <mimeMap fileExtension=".mov" mimeType="video/quicktime" /> </staticContent> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> </customHeaders> </httpProtocol> <caching> <profiles> <add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" /> <add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" /> <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" /> <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" /> </profiles> </caching> </system.webServer> </configuration>
2、HTML
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf⑻"/> <style> body,center{ padding:0; margin:0; } </style> </head> <body> <center> <video id="video" width="640" height="480" muted controls autoplay="autoplay" preload="auto" > <source src="月半湾.mov" /> 您的访问器不适用 HTML5 video 标识。 </video> </center> </body> </html>
本例会全自动播发。全自动播发的重要是“muted”特性(静音),不然不管是申明autoplay=“autoplay”,還是用脚本制作video.play()都不起功效。这个应当是有意设计方案成这样的。不然,开启就全自动播发,万1是感情姿势片如何办?假如静音就少了很多顾忌。
总结
以上所述是网编给大伙儿详细介绍的html5全自动播发mov文件格式视頻的案例编码,期待对大伙儿有一定的协助,假如大伙儿有任何疑惑请给我留言,网编会立即回应大伙儿的。在此也十分谢谢大伙儿对脚本制作之家网站的适用!
假如你感觉本文对你有协助,欢迎转载,烦请注明出处,感谢!