checkpoint - participant & tracks initial stubs

This commit is contained in:
David Zhao
2021-07-20 23:08:37 -07:00
parent 10ab3cdcac
commit 0a682f7831
12 changed files with 306 additions and 20 deletions
+4
View File
@@ -4,3 +4,7 @@ class TrackDimension {
TrackDimension(this.width, this.height);
}
class Track {
String? sid;
}
+31
View File
@@ -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);
}
}
}