可以播放二进制音频流的Flash音频播放器
我的服务器正在将二进制音频数据(主要是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前我不知道有任何服务可以提供您所寻求的服务(而且我不太确定如何实现)。但是,这里还有另一个选择:
使用 Flowplayer 等服务为您播放音频。一旦您知道如何使用 Flowplayer,您就可以做出另一个选择。您可以
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
file://
ordata:
protocols to avoid server side scripting. The problem with using thefile://
ordata:
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 like
mp3player.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.