This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

MediaStreamTrack.clone()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2017년 9월⁩.

MediaStreamTrack 인터페이스의 clone() 메서드는 MediaStreamTrack 객체의 사본을 반환합니다. 사본은 새로운 id를 제외하면 모든 값이 원본과 동일합니다.

구문

js
const newTrack = track.clone();

반환 값

clone()을 호출한 MediaStreamTrack에서 id를 제외하면 똑같은 새로운 MediaStreamTrack.

명세

Specification
Media Capture and Streams
# dom-mediastreamtrack-clone

브라우저 호환성