{{APIRef()}}
The MediaElementAudioSourceNode
interface represents an audio source consisting of an HTML5 {{ htmlelement("audio") }} or {{ htmlelement("video") }} element. It is an {{domxref("AudioNode")}} that acts as an audio source.
A MediaElementSourceNode
has no inputs and exactly one output, and is created using the {{domxref("AudioContext.createMediaElementSource")}} method. The amount of channels in the output equals the number of channels of the audio referenced by the {{domxref("HTMLMediaElement")}} used in the creation of the node, or is 1 if the {{domxref("HTMLMediaElement")}} has no audio.
- Number of inputs
0
- Number of outputs
1
- Channel count defined by the media in the {{domxref("HTMLMediaElement")}} passed to the {{domxref("AudioContext.createMediaElementSource")}} method that created it.
Properties
Inherits properties from its parent, {{domxref("AudioNode")}}.
Methods
Inherits methods from its parent, {{domxref("AudioNode")}}.
Example
{{page("/en-US/docs/Web/API/AudioContext.createMediaElementSource","Example")}}
Specification
Specification | Status | Comment |
---|---|---|
{{SpecName('Web Audio API', '#the-mediaelementaudiosourcenode-interface', 'MediaElementAudioSourceNode')}} | {{Spec2('Web Audio API')}} |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 14 {{property_prefix("webkit")}} | 23 | {{CompatNo}} | 15 {{property_prefix("webkit")}} 22 (unprefixed) |
6 {{property_prefix("webkit")}} |
Feature | Android | Chrome | Firefox Mobile (Gecko) | Firefox OS | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | 28 {{property_prefix("webkit")}} | 25 | 1.2 | {{CompatNo}} | {{CompatNo}} | 6 {{property_prefix("webkit")}} |