Firefox中的HTML5音频标签错误

HTML5 audio tag bug in Firefox

本文关键字:标签 错误 音频 HTML5 中的 Firefox      更新时间:2023-09-26

我正在使用<audio>标签建立一个带有音乐播放器的网站。

我正在使用jQuery做一些基本的操作,如"暂停"answers"播放":

$("#music_player")[0].pause();
$("#music_player")[0].play();

在Chrome中一切似乎都很好,但在Firefox中却不工作。

有谁知道是什么问题吗?或者JavaScript中的其他命令可以控制音频标记吗?

首先,我建议您点击以下链接:http://www.position-absolute.com/articles/introduction-to-the-html5-audio-tag-javascript-manipulation/

它给出了一个如何在html中使用音频标签和在javascript中操作它的例子。如果你看到的是Your browser does not support the audio tag.而不是音频小部件,那是因为你的firefox版本不支持HTML5音频标签

Opera和Firefox无法播放mp3文件。同时使用。. ogg和.mp3格式在所有浏览器中播放音频。

<audio id="music_player">
    <source src="sound.mp3"></source>
    <source src="sound.ogg"></source>
</audio>