MediaElementAudioSourceNode

The MediaElementAudioSourceNode interface represents an audio source consisting of an HTML5 <audio> or <video> element. It is an AudioNode that acts as an audio source.

A MediaElementSourceNode has no inputs and exactly one output, and is created using the AudioContext.createMediaElementSource() method. The amount of channels in the output equals the number of channels of the audio referenced by the HTMLMediaElement used in the creation of the node, or is 1 if the HTMLMediaElement has no audio.

Number of inputs 0
Number of outputs 1
Channel count defined by the media in the HTMLMediaElement passed to the AudioContext.createMediaElementSource method that created it.

Constructor

MediaElementAudioSourceNode()

Creates a new MediaElementAudioSourceNode object instance.

Properties

Inherits properties from its parent, AudioNode.

mediaElement Read only

The HTMLMediaElement used when constructing this MediaStreamAudioSourceNode.

Methods

Inherits methods from its parent, AudioNode.

Example

See AudioContext.createMediaElementSource() for example code.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
MediaElementAudioSourceNode
14
12
25
No
15
6
≤37
18
25
14
6
1.0
MediaElementAudioSourceNode
55
Before Chrome 59, the default values were not supported.
79
53
No
42
14.1
55
Before version 59, the default values were not supported.
55
Before Chrome 59, the default values were not supported.
53
42
14.5
6.0
Before Samsung Internet 7.0, the default values were not supported.
mediaElement
14
≤79
70
No
15
6
≤37
18
No
14
6
1.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaElementAudioSourceNode