Match muted behavior with JS SDK (#32)

* attempt 1

* implement

* clean up

* clean up

* cleaner code

* mute was opposite

* fix suggestion

* fix local pub muted

* update example

* update pubs

* format
This commit is contained in:
Hiroshi Horie
2021-11-20 02:39:52 +07:00
committed by GitHub
parent 4a59a1e6d5
commit 4f0973ce66
15 changed files with 199 additions and 130 deletions
+6 -3
View File
@@ -33,6 +33,9 @@ abstract class Track extends DisposableChangeNotifier
bool _active = false;
bool get isActive => _active;
bool _muted = false;
bool get muted => _muted;
Track(
this.kind,
this.source,
@@ -52,9 +55,6 @@ abstract class Track extends DisposableChangeNotifier
});
}
bool get muted =>
mediaStreamTrack.muted == null ? false : mediaStreamTrack.muted!;
rtc.RTCRtpMediaType get mediaType {
switch (kind) {
case lk_models.TrackType.AUDIO:
@@ -125,4 +125,7 @@ abstract class Track extends DisposableChangeNotifier
'[$objectId] set rtc.mediaStreamTrack.enabled did throw ${_}');
}
}
@internal
void updateMuted(bool muted) => _muted = muted;
}