MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!
この記事を English (US) で読むこともできます。

An addtrack  is fired when the browser adds a track to a MediaStream (such as when a RTCPeerConnection is renegotiated or a stream being captured using HTMLMediaElement.captureStream() gets a new set of tracks because the media element being captured loaded a new source.

The addtrack event does not get fired when JavaScript code explicitly adds tracks to the stream (by calling addTrack()).

An event handler for this event can be added by setting the MediaStream.onaddtrack property, or by calling addEventListener() on the MediaStream which you want to monitor for track additions.

General info

Specification
Media Capture and Streams
The definition of 'addtrack' in that specification.
Interface
MediaStreamTrackEvent
Bubbles
No
Cancelable
No
Target
MediaStream
Default Action
None

Properties

This event implements the properties of MediaStreamTrackEvent.

Methods

This event implements the methods of MediaStreamTrackEvent.

Specifications

Specification Status Comment
Media Capture and Streams
The definition of 'addtrack' in that specification.
Editor's Draft  

Browser compatibility

 

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) 50 (50) No support (Yes) ?
  
Feature Android Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? (Yes) (Yes) 50.0 (50) No support ? ?

See also

ドキュメントのタグと貢献者

 このページの貢献者: teoli, erikadoyle, Sheppy
 最終更新者: teoli,