Ruby 在 HTML 5 上播放 spx 格式的音频文件,有啥好的方案?

lup165340815 · June 24, 2015 · Last by lup165340815 replied at June 24, 2015 · 2927 hits

各位大神如何在 tml5 上播放 spx 音频文件,不依赖插件 使用 audio 标签?

标准说:

The type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it.

也就意味着,HTML5 的 audio 是没有对支持的格式做任何限定的,然而能不能播放并不是由 audio 决定的,而是由浏览器决定的。我记得 .spx 应该是 Ogg Vorbis compatible 的吧?那应该可以直接播放的。不过你得先搞定你的服务器,HTTP Server 应能够在客户端请求的时候返回正确的 MIME Type 供浏览器识别。你的情况我不清楚,自己去搞定 server 端的配置吧。

#1 楼 @nightire 恩 刚看了篇文章,配置 web.config 的 MIME 类型,我试试看

You need to Sign in before reply, if you don't have an account, please Sign up first.