可以播放二进制音频流的Flash音频播放器

发布于 2024-10-31 20:43:32 字数 228 浏览 0 评论 0原文

我的服务器正在将二进制音频数据(主要是 mp3 文件)流式传输到客户端(浏览器)。该客户端将音频数据存储在内存中。

我正在寻找的是一个闪存音频播放器,我可以输入二进制音频数据,以便它可以播放音频文件。

最好,Flash 客户端只是到 Javascript 的桥梁,以便我可以处理 Javascript 中的所有内容并简单地使用 Flash 的音频功能,但这不是必需的。

这样的音频播放器存在吗?

My server is streaming binary audio data (mostly mp3 files) to a client (a browser). This client stores the audio data in memory.

What I'm looking for is a flash audio player that I can input the binary audio data so that it can play the audio file.

Preferably, the flash client is merely a bridge to Javascript so that I can handle everything in Javascript and simply use Flash's audio features, but this is not a requirement.

Does such audio player exist?

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

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

发布评论

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

评论(1

伤感在游骋 2024-11-07 20:43:33

目前我不知道有任何服务可以提供您所寻求的服务(而且我不太确定如何实现)。但是,这里还有另一个选择:

使用 Flowplayer 等服务为您播放音频。一旦您知道如何使用 Flowplayer,您就可以做出另一个选择。您可以

  1. 有一个 PHP 或 ASP 页面,用户将文件(临时)上传到您的服务器,然后您让 Flowplayer 加载它(如下例所示)。或者,
  2. 您可以使用 file://data: 协议来避免服务器端脚本编写。使用 file://data: 协议的问题是它不能跨浏览器。

如果您打算尝试服务器端方法(推荐用于跨浏览器功能),那么 这里是一个示例正在处理。 在此示例中,您选择一个文件,然后将其上传到服务器。完成后,我让 Flowplayer 加载该文件,这就是它的全部内容。

顺便说一句,Flowplayer 更像是一个电影播放器​​,因此您可以查看这个 MP3 闪存播放器。与 Flowplayer 的概念相同,上传临时文件,然后让该服务播放该文件。

您尝​​试做的问题是您无法向 Flash 文件提供大量输入。这是因为要提供输入,您需要链接到诸如 mp3player.swf?file=file.mp3 之类的内容。这告诉 flash 文件要做什么。您不能提供此二进制输入(甚至是 base64),因为 url 长度有限制。

Currently I do not know of any service that offers what you are seeking (and I'm not quite sure how it would be possible). However, here is another option for you:

Use a service like Flowplayer to play the audio for you. Once you know how to use Flowplayer, you have another choice to make. You can either

  1. Have a PHP or ASP page where the user uploads a file (temporarily) to your server and then you have Flowplayer load it (this is like the example below). Or,
  2. You can use the file:// or data: protocols to avoid server side scripting. The problem with using the file:// or data: protocols is that it won't be cross browser.

If you are going to try the server side method (recommended for cross-browser functionality) then here is an example I am working on. In this example, you pick a file and it is then uploaded to the server. After that is done, I have Flowplayer load the file and that's all there is to it.

By the way Flowplayer was built more as a movie player so you can check out this mp3 flash player. Same concept as Flowplayer for this, upload the temporary file and then have this service play the file.

The problem with you are trying to do is that you can't give a large amount of input to a flash file. This is because to give input, you would link to something likemp3player.swf?file=file.mp3. This tells the flash file what to do. You can't give this binary input (even base64) because there is a limit on url length.

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