throw if unknown track type

This commit is contained in:
Hiroshi Horie
2021-12-03 02:02:28 +07:00
parent c38f192a07
commit 2244e31e5b
+5 -3
View File
@@ -104,12 +104,14 @@ class RemoteParticipant extends Participant<RemoteTrackPublication> {
// create 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
track = RemoteAudioTrack(pub.name, pub.source, stream, mediaTrack);
} else {
// video track
track = RemoteVideoTrack(pub.name, pub.source, stream, mediaTrack);
throw UnexpectedStateException('Unknown track type');
}
await track.start();