本地播放的音频文件与Flash和/或HTML5 [英] Playing local audio files with Flash and/or HTML5
问题描述
我意识到可以通过传递一个URL玩Flash和HTML5音频。
然而,是否有可能使用文件浏览器(无论是与HTML5或Flash),到那么玩这个本地文件,以获得音频文件的引用,再次使用Flash或HTML5?
当然,这应该发生没有服务器的干扰。由于文件是已经在本地系统中,它不通过服务器有意义路线只再次接收相同的文件。
潜在的解决方案:
window.URL.createObjectURL
和 音频(SRC)
该解决方案适用于创建对象的URL和图片
构造函数,但我不知道怎么固体音频
构造函数的支持。
不要有支持这两个可用的浏览器,但随时对其进行测试。您需要使用 HTML5文件API 使用JavaScript <上传音频文件,并操纵它/ p>
I realize it is possible to play audio with Flash and HTML5 by passing a URL.
However, is it possible to get a reference to an audio file using a file browser (either with HTML5 or Flash), to then play this local file, again using either Flash or HTML5?
Of course, this should happen without the interference of a server. Since the file is already on the local system, it does not make sense to route it through a server only to receive the same file again.
Potential solution :
window.URL.createObjectURL
and Audio(src)
This solution works with creating object urls and the Image
constructor but I'm not sure how solid the Audio
constructor support is.
Don't have a browser that supports both of those available but feel free to test them. You'll need to use the HTML5 File API to upload the audio file and manipulate it with JavaScript
这篇关于本地播放的音频文件与Flash和/或HTML5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!