Safari <input type=“file” accept=“video/*”> ignores mp4 files

折月煮酒 提交于 2019-12-02 17:51:30

I found that the following accept string will add mp4 and m4v to the list of file types that safari will accept:

accept="video/mp4,video/x-m4v,video/*"

I'm not sure what the mime type is for webm videos but if you can look that up you should be able to tack it on to the accept string. The trick is to specify the mime type, just using a file extension won't work.

You can take a look at webkit source code ~/Source/WebCore/platform/MIMETypeRegistry.cpp.

These types are customized by Apple for Safari, and may not be working on other browsers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!