throw if unknown track type
This commit is contained in:
@@ -104,12 +104,14 @@ class RemoteParticipant extends Participant<RemoteTrackPublication> {
|
|||||||
|
|
||||||
// create Track
|
// create Track
|
||||||
final RemoteTrack track;
|
final RemoteTrack track;
|
||||||
if (pub.kind == lk_models.TrackType.AUDIO) {
|
if (pub.kind == lk_models.TrackType.VIDEO) {
|
||||||
|
// video track
|
||||||
|
track = RemoteVideoTrack(pub.name, pub.source, stream, mediaTrack);
|
||||||
|
} else if (pub.kind == lk_models.TrackType.AUDIO) {
|
||||||
// audio track
|
// audio track
|
||||||
track = RemoteAudioTrack(pub.name, pub.source, stream, mediaTrack);
|
track = RemoteAudioTrack(pub.name, pub.source, stream, mediaTrack);
|
||||||
} else {
|
} else {
|
||||||
// video track
|
throw UnexpectedStateException('Unknown track type');
|
||||||
track = RemoteVideoTrack(pub.name, pub.source, stream, mediaTrack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await track.start();
|
await track.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user