MediaStream.addTrack()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
MediaStream.addTrack()
方法会给流添加一个新轨道。指定一个MediaStreamTrack
对象作为参数。
备注: 如果指定的 track 已经存在于流的 track set 里的话,该方法不会产生作用。
语法
js
stream.addTrack(track);
Parameters
track
-
A
MediaStreamTrack
to add to the stream.
Example
Specifications
Specification |
---|
Media Capture and Streams # dom-mediastream-addtrack |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
addTrack |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
See also
MediaStream
, the interface it belongs to.