fix: stop audio track on mute. (#207)

* fix: stop audio track on mute.

* chore: Let audioBitrate preset to music.

* update.

* update depends.

* update.
This commit is contained in:
CloudWebRTC
2022-11-14 19:13:48 +08:00
committed by GitHub
parent 663fc313c8
commit 27ea869443
12 changed files with 98 additions and 46 deletions
+14
View File
@@ -52,6 +52,20 @@ mixin LocalAudioManagementMixin on LocalTrack, AudioTrack {
}
return didUpdate;
}
Future<void> onTrackStopped() async {
await _trackCounterLock.synchronized(() async {
_localTrackCount--;
await _onAudioTrackCountDidChange();
});
}
Future<void> onTrackStarted() async {
await _trackCounterLock.synchronized(() async {
_localTrackCount++;
await _onAudioTrackCountDidChange();
});
}
}
mixin RemoteAudioManagementMixin on RemoteTrack, AudioTrack {
/// Start playing audio track. On web platform, create an audio element and