W3cubDocs

/Web APIs

MediaStream: clone() method

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

js

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

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 35 12 48 No 22 11 37 35 48 22 11 3.0

© 2005–2023 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