better type for TrackPublication param
This commit is contained in:
@@ -107,7 +107,7 @@ class RemoteParticipant extends Participant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create Track
|
// create Track
|
||||||
final Track track;
|
final RemoteTrack track;
|
||||||
if (pub.kind == lk_models.TrackType.AUDIO) {
|
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);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import '../internal/events.dart';
|
|||||||
import '../participant/local_participant.dart';
|
import '../participant/local_participant.dart';
|
||||||
import '../proto/livekit_models.pb.dart' as lk_models;
|
import '../proto/livekit_models.pb.dart' as lk_models;
|
||||||
import '../track/local.dart';
|
import '../track/local.dart';
|
||||||
import '../track/track.dart';
|
|
||||||
import 'track_publication.dart';
|
import 'track_publication.dart';
|
||||||
|
|
||||||
class LocalTrackPublication<T extends LocalTrack> extends TrackPublication {
|
class LocalTrackPublication<T extends LocalTrack> extends TrackPublication {
|
||||||
@@ -17,7 +16,7 @@ class LocalTrackPublication<T extends LocalTrack> extends TrackPublication {
|
|||||||
LocalTrackPublication({
|
LocalTrackPublication({
|
||||||
required this.participant,
|
required this.participant,
|
||||||
required lk_models.TrackInfo info,
|
required lk_models.TrackInfo info,
|
||||||
required Track track,
|
required T track,
|
||||||
}) : super(info: info) {
|
}) : super(info: info) {
|
||||||
updateTrack(track);
|
updateTrack(track);
|
||||||
// register dispose func
|
// register dispose func
|
||||||
@@ -28,7 +27,7 @@ class LocalTrackPublication<T extends LocalTrack> extends TrackPublication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> updateTrack(Track? newValue) async {
|
Future<bool> updateTrack(covariant T? newValue) async {
|
||||||
final didUpdate = await super.updateTrack(newValue);
|
final didUpdate = await super.updateTrack(newValue);
|
||||||
|
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class RemoteTrackPublication<T extends RemoteTrack> extends TrackPublication {
|
|||||||
RemoteTrackPublication({
|
RemoteTrackPublication({
|
||||||
required this.participant,
|
required this.participant,
|
||||||
required lk_models.TrackInfo info,
|
required lk_models.TrackInfo info,
|
||||||
Track? track,
|
T? track,
|
||||||
}) : super(info: info) {
|
}) : super(info: info) {
|
||||||
// register dispose func
|
// register dispose func
|
||||||
onDispose(() async {
|
onDispose(() async {
|
||||||
@@ -149,7 +149,7 @@ class RemoteTrackPublication<T extends RemoteTrack> extends TrackPublication {
|
|||||||
|
|
||||||
@internal
|
@internal
|
||||||
@override
|
@override
|
||||||
Future<bool> updateTrack(Track? newValue) async {
|
Future<bool> updateTrack(covariant T? newValue) async {
|
||||||
final didUpdate = await super.updateTrack(newValue);
|
final didUpdate = await super.updateTrack(newValue);
|
||||||
|
|
||||||
// Only listen for visibility updates if video optimization is on
|
// Only listen for visibility updates if video optimization is on
|
||||||
|
|||||||
Reference in New Issue
Block a user