javascript 音频方法的文档?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4589451/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Documentation for javascript audio methods?
提问by Bryan Downing
I've searched and found many articles that discuss the common methods you can use in javascript to control HTML audio elements. However, I have not been able to find anywhere that lists all of the methods available.
我搜索并找到了许多讨论可以在 javascript 中使用的常用方法来控制 HTML 音频元素的文章。但是,我找不到任何列出所有可用方法的地方。
I should make it clear that I'm not looking for HTML audio attributes. I'm looking for methods like audio.play()
and audio.pause()
. I've seen these methods used in code samples all over the place, but I can't find an exhaustive list for the life of me.
我应该明确指出我不是在寻找 HTML 音频属性。我正在寻找像audio.play()
和这样的方法audio.pause()
。我在各处的代码示例中都看到了这些方法,但我找不到适合我一生的详尽清单。
采纳答案by methodofaction
You're looking for something more generic: HTMLMediaElement, here are some reference guides:
您正在寻找更通用的东西:HTMLMediaElement,这里有一些参考指南:
https://developer.mozilla.org/en/DOM/HTMLMediaElement
https://developer.mozilla.org/en/DOM/HTMLMediaElement
http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#audio
http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#audio
https://developer.apple.com/documentation/webkitjs/htmlmediaelement
https://developer.apple.com/documentation/webkitjs/htmlmediaelement
回答by calvinf
For Mozilla Firefox's implementation (Gecko), see the following in the Mozilla Development Center:
有关 Mozilla Firefox 的实现 (Gecko),请参阅 Mozilla 开发中心中的以下内容:
- https://developer.mozilla.org/En/HTML/Element/Audio
- https://developer.mozilla.org/en/DOM/HTMLAudioElement
- https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension
- https://developer.mozilla.org/En/HTML/Element/Audio
- https://developer.mozilla.org/en/DOM/HTMLAudioElement
- https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension
For Internet Explorer 9 (currently beta), see the following at MSDN:
对于 Internet Explorer 9(当前为测试版),请参阅 MSDN 上的以下内容:
回答by Bart
http://dev.w3.org/html5/spec-author-view/video.html#audio(large document)
http://dev.w3.org/html5/spec-author-view/video.html#audio(大文件)
The play/pause methods can be found here: http://dev.w3.org/html5/spec-author-view/video.html#media-element
播放/暂停方法可以在这里找到:http: //dev.w3.org/html5/spec-author-view/video.html#media-element