Track constructor

Track(
  1. TrackType kind,
  2. TrackSource source,
  3. MediaStream _mediaStream,
  4. MediaStreamTrack _mediaStreamTrack,
  5. {RTCRtpReceiver? receiver}
)

Implementation

Track(this.kind, this.source, this._mediaStream, this._mediaStreamTrack,
    {this.receiver}) {
  // Any event emitted will trigger ChangeNotifier
  events.listen((event) {
    logger.fine('[TrackEvent] $event, will notifyListeners()');
    notifyListeners();
  });

  onDispose(() async {
    logger.fine('${objectId} onDispose()');
    await stop();
    // dispose events
    await events.dispose();
  });
}