diff --git a/lib/src/participant/remote_participant.dart b/lib/src/participant/remote_participant.dart index 4ecfc6c..a39ac09 100644 --- a/lib/src/participant/remote_participant.dart +++ b/lib/src/participant/remote_participant.dart @@ -104,12 +104,14 @@ class RemoteParticipant extends Participant { // 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();