我无法弄清楚如何将 ogg 文件合并到 HTML5 标签的播放列表中。现在我从目录 JSON 对象中读取文件,格式如下:
var playlist = [{"url":"mp3\/122911.mp3","title":"122911"},
{"url":"mp3\/100909.mp3","title":"100909"},{"url":"mp3\/011110.mp3","title":"011110"},
{"url":"mp3\/061207C.mp3","title":"061207C"},{"url":"mp3\/110309.mp3","title":"110309"},
{"url":"mp3\/120409.mp3","title":"120409"},{"url":"mp3\/031608.mp3","title":"031608"},
{"url":"mp3\/100609C.mp3","title":"100609C"},{"url":"mp3\/120408.mp3","title":"120408"},
{"url":"mp3\/012908.mp3","title":"012908"},{"url":"mp3\/032107.mp3","title":"032107"}]
这可以创造奇迹并将 ogg 文件加载到该对象中不是问题。我只需要知道如何告诉Firefox ogg 文件就在那里。为了在 JSON 中与“url”和“title”一起执行此操作,我是否缺少一个参数?我知道如果我只是静态地创建所有内容,它可以直接放在音频标签中,但我不是。音频标签很简单:
<audio class="aud" autoplay>
<p>Your browser doesn't support HTML 5 audio.</p>
</audio>
到目前为止,它适用于 chrome 和 safari 中的 mp3。我知道我错过了一些简单的东西。我有 ogg 文件,只是对播放列表中的参数感到困惑。谢谢!