MediaStreamTrackEvent interface represents events which indicate that a MediaStream has had tracks added to or removed from the stream through calls to Media Stream API methods. These events are sent to the stream when these changes occur.

  <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="../API/Event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text  x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25  86,20  86,30  76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/MediaStreamTrackEvent" target="_top"><rect x="116" y="1" width="210" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text  x="221" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MediaStreamTrackEvent</text></a></svg></div>
					
  a:hover text { fill: #0095DD; pointer-events: all;}
					

The events based on this interface are addtrack and removetrack

特性

Also inherits properties from its parent interface, 事件 .

track 只读
MediaStreamTrack object representing the track which was added to the stream.

构造函数

MediaStreamTrackEvent()
构造新的 MediaStreamTrackEvent with the specified configuration.

方法

Also inherits methods from its parent 事件 .

规范

规范 状态 注释
媒体捕获和流
The definition of 'MediaStreamTrackEvent' in that specification.
候选推荐

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
MediaStreamTrackEvent Chrome 55 Edge ≤18 Firefox 50 IE No Opera 42 Safari Yes WebView Android 55 Chrome Android 55 Firefox Android 50 Opera Android 42 Safari iOS Yes Samsung Internet Android 6.0
MediaStreamTrackEvent() 构造函数 Chrome 55 Edge ≤79 Firefox 50 IE No Opera 42 Safari ? WebView Android 55 Chrome Android 55 Firefox Android 50 Opera Android 42 Safari iOS ? Samsung Internet Android 6.0
track Chrome Yes Edge 12 Firefox Yes IE No Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

另请参阅

元数据

  • 最后修改: