How can I play .3gp audio file in HTML

落花浮王杯 提交于 2019-12-09 18:31:52

问题


I am using simple HTML5 audio tag. For .mp3 file it is working fine.
But I want to play .3gp file.

<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>

回答1:


Browsers support only limited audio formats. see

  • http://caniuse.com/#search=audio

3GP files are not playable in all browsers. Convert 3GP files to MP3 files, for example using Audacity audio editor.




回答2:


You have to use video tag for video, because 3gp is a video extension.

<source
  src="video.3gp"
  type='video/3gpp; codecs="mp4v.20.8, samr"'>
</source>

to learn more you can read this page on Mozilla.



来源:https://stackoverflow.com/questions/35433202/how-can-i-play-3gp-audio-file-in-html

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