Is there any way that HTML Audio tag could play mp3 in Firefox

前端 未结 5 844
长发绾君心
长发绾君心 2021-01-27 13:12

Is there any way that HTML Audio tag could play mp3 in Firefox.

相关标签:
5条回答
  • 2021-01-27 13:36

    FF currently supports only ogg formats, so you've to include a copy with ogg format as well:

    <audio controls="controls"> 
        <source src="music.ogg" type="audio/ogg" />
        <source src="music.mp3" type="audio/mpeg" />
        Your browser does not support the audio element.
    </audio>
    

    And for sake, use old object tag for embedding you mp3 file as follows:

    <object data="music.mp3" type="application/x-mplayer2" width="xxx" height="xxx">
        <param name="filename" value="music.mp3">
    </object>
    

    or use embed as:

    <embed type="application/x-mplayer2" src="music.mp3" height="xxx" width="xxx" >
    
    0 讨论(0)
  • 2021-01-27 13:40

    For those still looking now after FF v21 (I think) mp3 and HTML 5 audio tag works

    0 讨论(0)
  • 2021-01-27 13:44

    All you have to do is wait another 5 years until the remaining MP3 patents expire...

    0 讨论(0)
  • 2021-01-27 13:45

    Strangly enough, firefox 3.6x and 4.x played mp3 flawless, with

    <EMBED src="music.mp3" autostart=true loop=true volume=100 hidden=true>
    

    Have two instances on my linuxbox: Firefox 4.0.1 and Firefox 20.0-> same page playes its mp3 in version 4.0.1 and does not in firefox 20.0.

    0 讨论(0)
  • 2021-01-27 13:57

    It seems that Firefox does not support .mp3 in their audio tag. See this StackOverflow post for more detail.

    0 讨论(0)
提交回复
热议问题