Participant ChangeNotifier

This commit is contained in:
David Zhao
2021-07-25 22:22:11 -07:00
parent a47c50c3c1
commit d193b9fb7f
6 changed files with 70 additions and 5 deletions
@@ -10,4 +10,22 @@ class LocalTrackPublication extends TrackPublication {
: super.fromInfo(info) {
this.track = track;
}
set muted(bool val) {
if (val == muted) {
return;
}
super.muted = val;
track?.mediaTrack.enabled = !val;
_participant.engine.client.sendMuteTrack(sid, val);
if (val) {
_participant.delegate?.onTrackMuted(_participant, this);
_participant.roomDelegate?.onTrackMuted(_participant, this);
} else {
_participant.delegate?.onTrackUnmuted(_participant, this);
_participant.roomDelegate?.onTrackUnmuted(_participant, this);
}
_participant.muteChanged();
}
}
@@ -46,6 +46,7 @@ class RemoteTrackPublication extends TrackPublication {
_participant.delegate?.onTrackUnmuted(_participant, this);
_participant.roomDelegate?.onTrackUnmuted(_participant, this);
}
_participant.muteChanged();
}
RemoteTrackPublication(TrackInfo info, this._participant, [Track? track])