checkpoint - participant & tracks initial stubs
This commit is contained in:
@@ -4,3 +4,7 @@ class TrackDimension {
|
||||
|
||||
TrackDimension(this.width, this.height);
|
||||
}
|
||||
|
||||
class Track {
|
||||
String? sid;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import '../proto/livekit_models.pb.dart';
|
||||
import 'track.dart';
|
||||
|
||||
class TrackPublication {
|
||||
Track? track;
|
||||
String name;
|
||||
String sid;
|
||||
TrackType kind;
|
||||
bool muted = false;
|
||||
bool simulcasted = false;
|
||||
TrackDimension? dimension;
|
||||
|
||||
bool get isSubscribed => track != null;
|
||||
|
||||
TrackPublication({required this.sid, required this.name, required this.kind});
|
||||
|
||||
TrackPublication.fromInfo(TrackInfo info)
|
||||
: sid = info.sid,
|
||||
name = info.name,
|
||||
kind = info.type {
|
||||
_updateFromInfo(info);
|
||||
}
|
||||
|
||||
_updateFromInfo(TrackInfo info) {
|
||||
muted = info.muted;
|
||||
simulcasted = info.simulcast;
|
||||
if (info.type == TrackType.VIDEO) {
|
||||
dimension = new TrackDimension(info.width, info.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user