![](/img/trans.png)
[英]Specify that src=“” in <audio> is a mp3 file without .mp3 extension?
[英]Why HTML `<input type=“file” />` accept property `audio/mpeg` and `audio/mp3` works the same if I just want to select MP3?
請看這兩個最小的例子
<input type="file" accept="audio/mpeg">
<input type="file" accept="audio/mp3">
這兩個例子都可以 select 唯一的 MP3,為什么會這樣?
如果我想強制我的用戶只使用 select 一個 MP3 文件,我應該使用哪個代碼片段?
哪一個是最好的?
MP3 只是 MPEG 文件的音頻部分,因此指定audio/mpeg
等同於指定audio/mp3
。
有關媒體格式的更多信息,請參閱MDN 上的這篇文章。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.