Firefox 将玩 Ogg

发布于 2024-09-15 16:28:56 字数 295 浏览 3 评论 0原文

我有一个使用 Alt WAV MP3 Ogg Converter 从 mp3 转换而来的 ogg/音频文件。 当我在 Firefox 或 Google Chrome 中拖放文件时,音频播放得很好。 但是,当使用以下代码将文件放置在页面内时,它仅适用于 Chrome。

我的代码很简单:

<audio controls>  
     <source src="foo.ogg" type="audio/ogg">  
</audio>

有人可以告诉我为什么吗?

谢谢

I have an ogg/audio file converted from mp3 using Alt WAV MP3 Ogg Converter.
When I drag and drop the file in Firefox or in Google Chrome, the audio plays nicely.
But when a use the following code to place the file inside a page it only works on Chrome.

My code is simple as that:

<audio controls>  
     <source src="foo.ogg" type="audio/ogg">  
</audio>

Someone can tell me why?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迟月 2024-09-22 16:28:56

我想您可以在此处找到答案。
就我而言,我必须将 MIME 类型添加到我们的 nginx 服务器。

I think you can find your answer here.
In my case I had to add MIME types to our nginx server.

舟遥客 2024-09-22 16:28:56

因为这适用于 IE:

<source src="foo.ogg" type="audio/mp3">` 

这适用于 Chrome、Mozilla、Safari、Opera

<source src="foo.ogg" type="audio/ogg"> 

Because this works on IE:

<source src="foo.ogg" type="audio/mp3">` 

And this works on Chrome, Mozilla, Safari, Opera

<source src="foo.ogg" type="audio/ogg"> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文