removePublishedTrack method
Implementation
Future<void> removePublishedTrack(String trackSid,
{bool notify = true}) async {
logger.finer('removePublishedTrack track sid: $trackSid, notify: $notify');
final pub = trackPublications.remove(trackSid);
if (pub == null) {
logger.warning('Publication not found $trackSid');
return;
}
await pub.dispose();
final track = pub.track;
// if has track
if (track != null) {
await track.stop();
[events, room.events].emit(TrackUnsubscribedEvent(
participant: this,
track: track,
publication: pub,
));
}
if (notify) {
[events, room.events].emit(TrackUnpublishedEvent(
participant: this,
publication: pub,
));
}
await pub.dispose();
}