How can I play .3gp audio file in HTML
15,113
Solution 1
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.
Solution 2
Browsers support only limited audio formats. see
3GP files are not playable in all browsers. Convert 3GP files to MP3 files, for example using Audacity audio editor.
Related videos on Youtube
Author by
Keval Garala
Updated on June 05, 2022Comments
-
Keval Garala about 2 years
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>
-
Keval Garala over 8 yearsNot working ..... <source src='filename.3gp' type='audio/wav'></source> <source src='filename.3gp' type='audio/mpeg'></source> <source src='filename.3gp' type='video/3gpp; codecs='mp4v.20.8, samr''></source>
-
zer00ne over 8 years
<source>
tags do not have a closing tag. Also the quotes are mangled on thetype
andcodecs
attributes' values. -
Mohammad Kermani over 8 years@zer00ne I think Mozilla is a good Source, I did not write this from myself, Take a look at Mozilla website in link in my answer!
-
zer00ne over 8 years@Kermani my bad, sorry. I looked at that mangled part of the type/codec and it's correct (never needed to use either one). As for the closing
</source>
tag, where it's under Error Handling for Mozilla, yet if you go to the<source>
page, it says "Tag omission ... It must have start tag, but must not have an end tag."