participant to parent (TrackPublication)

This commit is contained in:
Hiroshi Horie
2021-12-03 00:57:42 +07:00
parent 2fe32f7d72
commit 4c66704427
6 changed files with 53 additions and 32 deletions
+10 -2
View File
@@ -76,7 +76,11 @@ class LocalParticipant extends Participant {
);
await engine.negotiate();
final pub = LocalTrackPublication<LocalAudioTrack>(trackInfo, track, this);
final pub = LocalTrackPublication<LocalAudioTrack>(
participant: this,
info: trackInfo,
track: track,
);
addTrackPublication(pub);
[events, roomEvents].emit(LocalTrackPublishedEvent(
@@ -159,7 +163,11 @@ class LocalParticipant extends Participant {
);
await engine.negotiate();
final pub = LocalTrackPublication<LocalVideoTrack>(trackInfo, track, this);
final pub = LocalTrackPublication<LocalVideoTrack>(
participant: this,
info: trackInfo,
track: track,
);
addTrackPublication(pub);
[events, roomEvents].emit(LocalTrackPublishedEvent(
+8 -2
View File
@@ -143,9 +143,15 @@ class RemoteParticipant extends Participant {
if (pub == null) {
final RemoteTrackPublication pub;
if (trackInfo.type == lk_models.TrackType.VIDEO) {
pub = RemoteTrackPublication<RemoteVideoTrack>(trackInfo, this);
pub = RemoteTrackPublication<RemoteVideoTrack>(
participant: this,
info: trackInfo,
);
} else if (trackInfo.type == lk_models.TrackType.AUDIO) {
pub = RemoteTrackPublication<RemoteAudioTrack>(trackInfo, this);
pub = RemoteTrackPublication<RemoteAudioTrack>(
participant: this,
info: trackInfo,
);
} else {
throw UnexpectedStateException('Unknown track type');
}