MediaStream.clone()
The clone()
method of the MediaStream
interface creates a duplicate of the MediaStream
. This new MediaStream
object has a new unique id
and contains clones of every MediaStreamTrack
contained by the MediaStream
on which clone()
was called.
Syntax
var stream = MediaStream.clone();
Parameters
None.
Return value
A new MediaStream
instance which has a new unique ID and contains clones of every MediaStreamTrack
contained by the MediaStream
on which clone()
was called.
Specifications
Specification |
---|
Media Capture and Streams # dom-mediastream-clone |
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 | |
clone |
45 |
12 |
48 |
No |
No |
11 |
45 |
45 |
48 |
No |
11 |
5.0 |
© 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/MediaStream/clone