use object type instead of checking kind
This commit is contained in:
@@ -242,11 +242,15 @@ class LocalParticipant extends Participant {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
List<LocalTrackPublication<LocalVideoTrack>> get videoTracks =>
|
List<LocalTrackPublication<LocalVideoTrack>> get videoTracks =>
|
||||||
super.videoTracks.cast<LocalTrackPublication<LocalVideoTrack>>();
|
trackPublications.values
|
||||||
|
.whereType<LocalTrackPublication<LocalVideoTrack>>()
|
||||||
|
.toList();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<LocalTrackPublication<LocalAudioTrack>> get audioTracks =>
|
List<LocalTrackPublication<LocalAudioTrack>> get audioTracks =>
|
||||||
super.audioTracks.cast<LocalTrackPublication<LocalAudioTrack>>();
|
trackPublications.values
|
||||||
|
.whereType<LocalTrackPublication<LocalAudioTrack>>()
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
extension LocalParticipantTrackSourceExt on LocalParticipant {
|
extension LocalParticipantTrackSourceExt on LocalParticipant {
|
||||||
|
|||||||
@@ -77,13 +77,11 @@ abstract class Participant extends DisposableChangeNotifier
|
|||||||
List<TrackPublication> get subscribedTracks =>
|
List<TrackPublication> get subscribedTracks =>
|
||||||
trackPublications.values.where((e) => e.subscribed).toList();
|
trackPublications.values.where((e) => e.subscribed).toList();
|
||||||
|
|
||||||
List<TrackPublication> get videoTracks => trackPublications.values
|
// Must be implemented by child class
|
||||||
.where((e) => e.kind == lk_models.TrackType.VIDEO)
|
List<TrackPublication> get videoTracks;
|
||||||
.toList();
|
|
||||||
|
|
||||||
List<TrackPublication> get audioTracks => trackPublications.values
|
// Must be implemented by child class
|
||||||
.where((e) => e.kind == lk_models.TrackType.AUDIO)
|
List<TrackPublication> get audioTracks;
|
||||||
.toList();
|
|
||||||
|
|
||||||
/// for internal use
|
/// for internal use
|
||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
|
|||||||
@@ -27,11 +27,15 @@ class RemoteParticipant extends Participant {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
List<RemoteTrackPublication<RemoteVideoTrack>> get videoTracks =>
|
List<RemoteTrackPublication<RemoteVideoTrack>> get videoTracks =>
|
||||||
super.videoTracks.cast<RemoteTrackPublication<RemoteVideoTrack>>();
|
trackPublications.values
|
||||||
|
.whereType<RemoteTrackPublication<RemoteVideoTrack>>()
|
||||||
|
.toList();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<RemoteTrackPublication<RemoteAudioTrack>> get audioTracks =>
|
List<RemoteTrackPublication<RemoteAudioTrack>> get audioTracks =>
|
||||||
super.audioTracks.cast<RemoteTrackPublication<RemoteAudioTrack>>();
|
trackPublications.values
|
||||||
|
.whereType<RemoteTrackPublication<RemoteAudioTrack>>()
|
||||||
|
.toList();
|
||||||
|
|
||||||
RemoteParticipant(
|
RemoteParticipant(
|
||||||
this._engine,
|
this._engine,
|
||||||
|
|||||||
Reference in New Issue
Block a user