Apply Flutter best practices [Non-Breaking] (#2)
* Add flutter_lints package * Use key in widget constructors lint: use_key_in_widget_constructors * Unnecessary new keyword lint: unnecessary_new * Prefer const with constant constructors * Exclude protobuf files from analyzer * Private field could be final * Annotate overridden members * Use initializing formals when possible * Don't access members with `this` unless avoiding shadowing * Prefer is! operator * Use isEmpty instead of length * Use collection literals when possible * Revert comment changes * Cleaner null testing * Misc fixes * Avoid using `forEach` with a function literal * Prefer `final` over `var` where applicable * Enforce stricter type-checking * Ignore VS Code files * Flutter format * Prefer using lowerCamelCase for constant names * flutter format -l 100 * Disable `avoid_print` for examples * Slight improvements to example Should solve lint error: no_logic_in_create_state
This commit is contained in:
@@ -32,7 +32,7 @@ jobs:
|
|||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
|
|
||||||
# Check for any formatting issues in the code.
|
# Check for any formatting issues in the code.
|
||||||
- run: flutter format --set-exit-if-changed .
|
- run: flutter format --set-exit-if-changed -l 100 .
|
||||||
|
|
||||||
# Statically analyze the Dart code for any errors.
|
# Statically analyze the Dart code for any errors.
|
||||||
- run: flutter analyze .
|
- run: flutter analyze .
|
||||||
|
|||||||
@@ -73,3 +73,6 @@ build/
|
|||||||
!**/ios/**/default.mode2v3
|
!**/ios/**/default.mode2v3
|
||||||
!**/ios/**/default.pbxuser
|
!**/ios/**/default.pbxuser
|
||||||
!**/ios/**/default.perspectivev3
|
!**/ios/**/default.perspectivev3
|
||||||
|
|
||||||
|
# VS Code
|
||||||
|
.vscode/
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# This file configures the analyzer, which statically analyzes Dart code to
|
||||||
|
# check for errors, warnings, and lints.
|
||||||
|
#
|
||||||
|
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||||
|
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||||
|
# invoked from the command line by running `flutter analyze`.
|
||||||
|
|
||||||
|
# The following line activates a set of recommended lints for Flutter apps,
|
||||||
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
|
|
||||||
|
# https://pub.dev/packages/flutter_lints
|
||||||
|
|
||||||
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
|
analyzer:
|
||||||
|
#
|
||||||
|
# Enforce stricter type-checking
|
||||||
|
# https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks
|
||||||
|
# https://dash-overflow.net/articles/getting_started/#step-3-disabling-_implicit-dynamic_--_implicit-cast_
|
||||||
|
#
|
||||||
|
strong-mode:
|
||||||
|
implicit-casts: false
|
||||||
|
implicit-dynamic: false
|
||||||
|
|
||||||
|
#
|
||||||
|
# exclude protobuf files
|
||||||
|
#
|
||||||
|
exclude:
|
||||||
|
- '**/*.pb.dart'
|
||||||
|
- '**/*.pbenum.dart'
|
||||||
|
- '**/*.pbjson.dart'
|
||||||
|
- '**/*.pbserver.dart'
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
#
|
||||||
|
# Additional recommended rules
|
||||||
|
#
|
||||||
|
prefer_single_quotes: true
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# This file configures the analyzer, which statically analyzes Dart code to
|
||||||
|
# check for errors, warnings, and lints.
|
||||||
|
#
|
||||||
|
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||||
|
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||||
|
# invoked from the command line by running `flutter analyze`.
|
||||||
|
|
||||||
|
# The following line activates a set of recommended lints for Flutter apps,
|
||||||
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
|
|
||||||
|
# https://pub.dev/packages/flutter_lints
|
||||||
|
|
||||||
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
|
analyzer:
|
||||||
|
#
|
||||||
|
# Enforce stricter type-checking
|
||||||
|
# https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks
|
||||||
|
# https://dash-overflow.net/articles/getting_started/#step-3-disabling-_implicit-dynamic_--_implicit-cast_
|
||||||
|
#
|
||||||
|
strong-mode:
|
||||||
|
implicit-casts: false
|
||||||
|
implicit-dynamic: false
|
||||||
|
|
||||||
|
#
|
||||||
|
# exclude protobuf files
|
||||||
|
#
|
||||||
|
exclude:
|
||||||
|
- '**/*.pb.dart'
|
||||||
|
- '**/*.pbenum.dart'
|
||||||
|
- '**/*.pbjson.dart'
|
||||||
|
- '**/*.pbserver.dart'
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
#
|
||||||
|
# Additional recommended rules
|
||||||
|
#
|
||||||
|
prefer_single_quotes: true
|
||||||
|
|
||||||
|
#
|
||||||
|
# Turn off avoid_print for example projects
|
||||||
|
#
|
||||||
|
avoid_print: false
|
||||||
+57
-32
@@ -10,58 +10,86 @@ void main() {
|
|||||||
print('${record.level.name}: ${record.time}: ${record.message}');
|
print('${record.level.name}: ${record.time}: ${record.message}');
|
||||||
});
|
});
|
||||||
|
|
||||||
runApp(MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
// This widget is the root of your application.
|
//
|
||||||
|
const MyApp({
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) => MaterialApp(
|
||||||
return MaterialApp(
|
|
||||||
title: 'LiveKit Demo',
|
title: 'LiveKit Demo',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.deepPurple,
|
primarySwatch: Colors.deepPurple,
|
||||||
),
|
),
|
||||||
home: PreConnect(),
|
home: const PreConnectWidget(
|
||||||
|
url: '<livekit_host>',
|
||||||
|
token: '<access_token>',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class PreConnect extends StatefulWidget {
|
class PreConnectWidget extends StatefulWidget {
|
||||||
|
//
|
||||||
|
final String url;
|
||||||
|
final String token;
|
||||||
|
|
||||||
|
const PreConnectWidget({
|
||||||
|
required this.url,
|
||||||
|
required this.token,
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() => _PreConnectWidgetState();
|
||||||
return _PreConnectState(
|
|
||||||
'<livekit_host>',
|
|
||||||
'<access_token>',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PreConnectState extends State<PreConnect> {
|
class _PreConnectWidgetState extends State<PreConnectWidget> {
|
||||||
String url;
|
//
|
||||||
String token;
|
final _urlCtrl = TextEditingController();
|
||||||
|
final _tokenCtrl = TextEditingController();
|
||||||
|
|
||||||
_PreConnectState(this.url, this.token);
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_urlCtrl.text = widget.url;
|
||||||
|
_tokenCtrl.text = widget.token;
|
||||||
|
}
|
||||||
|
|
||||||
_connect(BuildContext context) async {
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_urlCtrl.dispose();
|
||||||
|
_tokenCtrl.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _connect(BuildContext context) async {
|
||||||
try {
|
try {
|
||||||
var room = await LiveKitClient.connect(this.url, this.token);
|
print('Connecting with url: ${_urlCtrl.text}, token: ${_tokenCtrl.text}...');
|
||||||
Navigator.push(
|
|
||||||
|
final room = await LiveKitClient.connect(
|
||||||
|
_urlCtrl.text,
|
||||||
|
_tokenCtrl.text,
|
||||||
|
);
|
||||||
|
|
||||||
|
Navigator.push<void>(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) {
|
MaterialPageRoute(builder: (context) {
|
||||||
return RoomWidget(room);
|
return RoomWidget(room);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("could not connect $e");
|
print('could not connect $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) => Scaffold(
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('Connect to LiveKit'),
|
title: const Text('Connect to LiveKit'),
|
||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -70,28 +98,25 @@ class _PreConnectState extends State<PreConnect> {
|
|||||||
margin: const EdgeInsets.all(10),
|
margin: const EdgeInsets.all(10),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
TextFormField(
|
TextField(
|
||||||
|
controller: _urlCtrl,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'URL',
|
labelText: 'URL',
|
||||||
),
|
),
|
||||||
onChanged: (value) => this.url,
|
|
||||||
initialValue: this.url,
|
|
||||||
),
|
),
|
||||||
TextFormField(
|
TextField(
|
||||||
|
controller: _tokenCtrl,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Token',
|
labelText: 'Token',
|
||||||
),
|
),
|
||||||
onChanged: (value) => this.token,
|
|
||||||
initialValue: this.token,
|
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => _connect(context),
|
onPressed: () => _connect(context),
|
||||||
child: Text('Connect'),
|
child: const Text('Connect'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+32
-33
@@ -4,9 +4,13 @@ import 'package:livekit_example/src/controls.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class RoomWidget extends StatefulWidget {
|
class RoomWidget extends StatefulWidget {
|
||||||
|
//
|
||||||
final Room room;
|
final Room room;
|
||||||
|
|
||||||
RoomWidget(this.room);
|
const RoomWidget(
|
||||||
|
this.room, {
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
@@ -32,16 +36,16 @@ class _RoomState extends State<RoomWidget> with RoomDelegate {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onConnected() async {
|
void _onConnected() async {
|
||||||
// video will fail when running in ios simulator
|
// video will fail when running in ios simulator
|
||||||
try {
|
try {
|
||||||
var localVideo = await LocalVideoTrack.createCameraTrack();
|
final localVideo = await LocalVideoTrack.createCameraTrack();
|
||||||
await widget.room.localParticipant.publishVideoTrack(localVideo);
|
await widget.room.localParticipant.publishVideoTrack(localVideo);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('could not publish video: $e');
|
print('could not publish video: $e');
|
||||||
}
|
}
|
||||||
|
|
||||||
var localAudio = await LocalAudioTrack.createTrack();
|
final localAudio = await LocalAudioTrack.createTrack();
|
||||||
await widget.room.localParticipant.publishAudioTrack(localAudio);
|
await widget.room.localParticipant.publishAudioTrack(localAudio);
|
||||||
sortParticipants();
|
sortParticipants();
|
||||||
}
|
}
|
||||||
@@ -65,14 +69,9 @@ class _RoomState extends State<RoomWidget> with RoomDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// last spoken at
|
// last spoken at
|
||||||
var aSpokeAt = a.lastSpokeAt?.millisecondsSinceEpoch;
|
final aSpokeAt = a.lastSpokeAt?.millisecondsSinceEpoch ?? 0;
|
||||||
var bSpokeAt = b.lastSpokeAt?.millisecondsSinceEpoch;
|
final bSpokeAt = b.lastSpokeAt?.millisecondsSinceEpoch ?? 0;
|
||||||
if (aSpokeAt == null) {
|
|
||||||
aSpokeAt = 0;
|
|
||||||
}
|
|
||||||
if (bSpokeAt == null) {
|
|
||||||
bSpokeAt = 0;
|
|
||||||
}
|
|
||||||
if (aSpokeAt != bSpokeAt) {
|
if (aSpokeAt != bSpokeAt) {
|
||||||
return aSpokeAt > bSpokeAt ? -1 : 1;
|
return aSpokeAt > bSpokeAt ? -1 : 1;
|
||||||
}
|
}
|
||||||
@@ -83,8 +82,7 @@ class _RoomState extends State<RoomWidget> with RoomDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// joinedAt
|
// joinedAt
|
||||||
return a.joinedAt.millisecondsSinceEpoch -
|
return a.joinedAt.millisecondsSinceEpoch - b.joinedAt.millisecondsSinceEpoch;
|
||||||
b.joinedAt.millisecondsSinceEpoch;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (participants.length > 1) {
|
if (participants.length > 1) {
|
||||||
@@ -99,8 +97,8 @@ class _RoomState extends State<RoomWidget> with RoomDelegate {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onDisconnected() {
|
void onDisconnected() {
|
||||||
var context = _lastContext;
|
final context = _lastContext;
|
||||||
print("disconnected: $context");
|
print('disconnected: $context');
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}
|
}
|
||||||
@@ -110,8 +108,8 @@ class _RoomState extends State<RoomWidget> with RoomDelegate {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
_lastContext = context;
|
_lastContext = context;
|
||||||
|
|
||||||
var mainWidgets = <Widget>[];
|
final mainWidgets = <Widget>[];
|
||||||
var participants = this.participants;
|
final participants = this.participants;
|
||||||
if (participants.isNotEmpty) {
|
if (participants.isNotEmpty) {
|
||||||
mainWidgets.add(Expanded(child: VideoView(participants.first)));
|
mainWidgets.add(Expanded(child: VideoView(participants.first)));
|
||||||
} else {
|
} else {
|
||||||
@@ -119,7 +117,7 @@ class _RoomState extends State<RoomWidget> with RoomDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (participants.length > 1) {
|
if (participants.length > 1) {
|
||||||
var videoList = ListView.builder(
|
final videoList = ListView.builder(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: participants.length - 1,
|
itemCount: participants.length - 1,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
@@ -127,12 +125,11 @@ class _RoomState extends State<RoomWidget> with RoomDelegate {
|
|||||||
width: 100,
|
width: 100,
|
||||||
height: 60,
|
height: 60,
|
||||||
padding: const EdgeInsets.all(2),
|
padding: const EdgeInsets.all(2),
|
||||||
child:
|
child: VideoView(participants[index + 1], quality: VideoQuality.LOW),
|
||||||
VideoView(participants[index + 1], quality: VideoQuality.LOW),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
mainWidgets.add(Container(
|
mainWidgets.add(SizedBox(
|
||||||
height: 60,
|
height: 60,
|
||||||
child: videoList,
|
child: videoList,
|
||||||
));
|
));
|
||||||
@@ -157,11 +154,15 @@ class _RoomState extends State<RoomWidget> with RoomDelegate {
|
|||||||
|
|
||||||
// displays a participant in view
|
// displays a participant in view
|
||||||
class VideoView extends StatefulWidget {
|
class VideoView extends StatefulWidget {
|
||||||
|
//
|
||||||
final Participant participant;
|
final Participant participant;
|
||||||
final VideoQuality quality;
|
final VideoQuality quality;
|
||||||
|
|
||||||
VideoView(this.participant, {VideoQuality quality = VideoQuality.MEDIUM})
|
const VideoView(
|
||||||
: this.quality = quality;
|
this.participant, {
|
||||||
|
this.quality = VideoQuality.MEDIUM,
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
@@ -175,13 +176,13 @@ class _VideoViewState extends State<VideoView> with ParticipantDelegate {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
widget.participant.addListener(this._onParticipantChanged);
|
widget.participant.addListener(_onParticipantChanged);
|
||||||
_onParticipantChanged();
|
_onParticipantChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
widget.participant.removeListener(this._onParticipantChanged);
|
widget.participant.removeListener(_onParticipantChanged);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,14 +196,12 @@ class _VideoViewState extends State<VideoView> with ParticipantDelegate {
|
|||||||
|
|
||||||
// register for change so Flutter will re-build the widget upon change
|
// register for change so Flutter will re-build the widget upon change
|
||||||
void _onParticipantChanged() {
|
void _onParticipantChanged() {
|
||||||
var subscribedVideos = widget.participant.videoTracks.values.where((pub) {
|
final subscribedVideos = widget.participant.videoTracks.values.where((pub) {
|
||||||
return pub.kind == TrackType.VIDEO &&
|
return pub.kind == TrackType.VIDEO && !pub.isScreenShare && pub.subscribed;
|
||||||
!pub.isScreenShare &&
|
|
||||||
pub.subscribed;
|
|
||||||
});
|
});
|
||||||
setState(() {
|
setState(() {
|
||||||
if (subscribedVideos.isNotEmpty) {
|
if (subscribedVideos.isNotEmpty) {
|
||||||
var videoPub = subscribedVideos.first;
|
final videoPub = subscribedVideos.first;
|
||||||
if (videoPub is RemoteTrackPublication) {
|
if (videoPub is RemoteTrackPublication) {
|
||||||
videoPub.videoQuality = widget.quality;
|
videoPub.videoQuality = widget.quality;
|
||||||
}
|
}
|
||||||
@@ -212,13 +211,13 @@ class _VideoViewState extends State<VideoView> with ParticipantDelegate {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.videoPub = null;
|
videoPub = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var videoPub = this.videoPub;
|
final videoPub = this.videoPub;
|
||||||
if (videoPub != null) {
|
if (videoPub != null) {
|
||||||
return VideoTrackRenderer(videoPub.track as VideoTrack);
|
return VideoTrackRenderer(videoPub.track as VideoTrack);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,10 +2,15 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:livekit_client/livekit_client.dart';
|
import 'package:livekit_client/livekit_client.dart';
|
||||||
|
|
||||||
class Controls extends StatefulWidget {
|
class Controls extends StatefulWidget {
|
||||||
|
//
|
||||||
final Room room;
|
final Room room;
|
||||||
final LocalParticipant participant;
|
final LocalParticipant participant;
|
||||||
|
|
||||||
Controls(this.room) : participant = room.localParticipant;
|
Controls(
|
||||||
|
this.room, {
|
||||||
|
Key? key,
|
||||||
|
}) : participant = room.localParticipant,
|
||||||
|
super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
@@ -14,7 +19,7 @@ class Controls extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ControlsState extends State<Controls> {
|
class _ControlsState extends State<Controls> {
|
||||||
CameraPosition position = CameraPosition.FRONT;
|
CameraPosition position = CameraPosition.front;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -30,48 +35,48 @@ class _ControlsState extends State<Controls> {
|
|||||||
|
|
||||||
LocalParticipant get participant => widget.participant;
|
LocalParticipant get participant => widget.participant;
|
||||||
|
|
||||||
_onChange() {
|
void _onChange() {
|
||||||
// trigger refresh
|
// trigger refresh
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
_muteAudio() {
|
void _muteAudio() {
|
||||||
if (participant.hasAudio) {
|
if (participant.hasAudio) {
|
||||||
var audioPub = participant.audioTracks.values.first;
|
final audioPub = participant.audioTracks.values.first;
|
||||||
audioPub.muted = true;
|
audioPub.muted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_unmuteAudio() async {
|
Future<void> _unmuteAudio() async {
|
||||||
if (participant.hasAudio) {
|
if (participant.hasAudio) {
|
||||||
var audioPub = participant.audioTracks.values.first;
|
final audioPub = participant.audioTracks.values.first;
|
||||||
audioPub.muted = false;
|
audioPub.muted = false;
|
||||||
} else {
|
} else {
|
||||||
// publish audio track
|
// publish audio track
|
||||||
var audioTrack = await LocalAudioTrack.createTrack();
|
final audioTrack = await LocalAudioTrack.createTrack();
|
||||||
await participant.publishAudioTrack(audioTrack);
|
await participant.publishAudioTrack(audioTrack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_muteVideo() {
|
void _muteVideo() {
|
||||||
if (participant.hasVideo) {
|
if (participant.hasVideo) {
|
||||||
var videoPub = participant.videoTracks.values.first;
|
final videoPub = participant.videoTracks.values.first;
|
||||||
videoPub.muted = true;
|
videoPub.muted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_unmuteVideo() async {
|
void _unmuteVideo() async {
|
||||||
if (participant.hasVideo) {
|
if (participant.hasVideo) {
|
||||||
var videoPub = participant.videoTracks.values.first;
|
final videoPub = participant.videoTracks.values.first;
|
||||||
videoPub.muted = false;
|
videoPub.muted = false;
|
||||||
} else {
|
} else {
|
||||||
// publish audio track
|
// publish audio track
|
||||||
var videoTrack = await LocalVideoTrack.createCameraTrack();
|
final videoTrack = await LocalVideoTrack.createCameraTrack();
|
||||||
await participant.publishVideoTrack(videoTrack);
|
await participant.publishVideoTrack(videoTrack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_setCameraPosition(TrackPublication? pub, CameraPosition position) async {
|
void _setCameraPosition(TrackPublication? pub, CameraPosition position) async {
|
||||||
if (this.position == position) {
|
if (this.position == position) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -96,13 +101,13 @@ class _ControlsState extends State<Controls> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_exit() {
|
void _exit() {
|
||||||
widget.room.disconnect();
|
widget.room.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var buttons = <Widget>[];
|
final buttons = <Widget>[];
|
||||||
|
|
||||||
// mute audio
|
// mute audio
|
||||||
if (participant.hasAudio && !participant.isMuted) {
|
if (participant.hasAudio && !participant.isMuted) {
|
||||||
@@ -127,7 +132,7 @@ class _ControlsState extends State<Controls> {
|
|||||||
videoPub = participant.videoTracks.values.first;
|
videoPub = participant.videoTracks.values.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
var videoEnabled = videoPub != null && !videoPub.muted;
|
final videoEnabled = videoPub != null && !videoPub.muted;
|
||||||
if (videoEnabled) {
|
if (videoEnabled) {
|
||||||
buttons.add(IconButton(
|
buttons.add(IconButton(
|
||||||
onPressed: _muteVideo,
|
onPressed: _muteVideo,
|
||||||
@@ -140,12 +145,12 @@ class _ControlsState extends State<Controls> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (position == CameraPosition.FRONT) {
|
if (position == CameraPosition.front) {
|
||||||
buttons.add(IconButton(
|
buttons.add(IconButton(
|
||||||
icon: const Icon(Icons.video_camera_front_rounded),
|
icon: const Icon(Icons.video_camera_front_rounded),
|
||||||
onPressed: videoEnabled
|
onPressed: videoEnabled
|
||||||
? () {
|
? () {
|
||||||
_setCameraPosition(videoPub, CameraPosition.BACK);
|
_setCameraPosition(videoPub, CameraPosition.back);
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
));
|
));
|
||||||
@@ -154,7 +159,7 @@ class _ControlsState extends State<Controls> {
|
|||||||
icon: const Icon(Icons.video_camera_back_rounded),
|
icon: const Icon(Icons.video_camera_back_rounded),
|
||||||
onPressed: videoEnabled
|
onPressed: videoEnabled
|
||||||
? () {
|
? () {
|
||||||
_setCameraPosition(videoPub, CameraPosition.FRONT);
|
_setCameraPosition(videoPub, CameraPosition.front);
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
));
|
));
|
||||||
|
|||||||
+21
-7
@@ -90,6 +90,13 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_lints:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: flutter_lints
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.4"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -116,6 +123,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "4.0.0"
|
||||||
|
lints:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: lints
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
livekit_client:
|
livekit_client:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -171,14 +185,14 @@ packages:
|
|||||||
name: path_provider_linux
|
name: path_provider_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.2"
|
||||||
path_provider_macos:
|
path_provider_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_macos
|
name: path_provider_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.2"
|
||||||
path_provider_platform_interface:
|
path_provider_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -192,7 +206,7 @@ packages:
|
|||||||
name: path_provider_windows
|
name: path_provider_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.3"
|
||||||
pedantic:
|
pedantic:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -206,7 +220,7 @@ packages:
|
|||||||
name: platform
|
name: platform
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.2"
|
||||||
plugin_platform_interface:
|
plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -220,7 +234,7 @@ packages:
|
|||||||
name: process
|
name: process
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.1"
|
version: "4.2.3"
|
||||||
protobuf:
|
protobuf:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -330,7 +344,7 @@ packages:
|
|||||||
name: win32
|
name: win32
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.5"
|
version: "2.2.7"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -340,4 +354,4 @@ packages:
|
|||||||
version: "0.2.0"
|
version: "0.2.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.13.0 <3.0.0"
|
dart: ">=2.13.0 <3.0.0"
|
||||||
flutter: ">=1.22.0"
|
flutter: ">=2.0.0"
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ dependencies:
|
|||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_lints: ^1.0.4
|
||||||
|
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import 'package:livekit_example/main.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||||
// Build our app and trigger a frame.
|
// Build our app and trigger a frame.
|
||||||
await tester.pumpWidget(MyApp());
|
await tester.pumpWidget(const MyApp());
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
// Verify that our counter starts at 0.
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import 'package:web_socket_channel/html.dart';
|
|||||||
import 'package:web_socket_channel/web_socket_channel.dart';
|
import 'package:web_socket_channel/web_socket_channel.dart';
|
||||||
|
|
||||||
Future<WebSocketChannel> connectToWebSocket(Uri uri) {
|
Future<WebSocketChannel> connectToWebSocket(Uri uri) {
|
||||||
var ws = WebSocket(uri.toString());
|
final ws = WebSocket(uri.toString());
|
||||||
ws.binaryType = 'arraybuffer';
|
ws.binaryType = 'arraybuffer';
|
||||||
var completer = Completer<WebSocketChannel>();
|
final completer = Completer<WebSocketChannel>();
|
||||||
ws.onOpen.first.then((_) {
|
ws.onOpen.first.then((_) {
|
||||||
completer.complete(HtmlWebSocketChannel(ws));
|
completer.complete(HtmlWebSocketChannel(ws));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import 'package:web_socket_channel/web_socket_channel.dart';
|
|||||||
Future<WebSocketChannel> connectToWebSocket(Uri uri) async {
|
Future<WebSocketChannel> connectToWebSocket(Uri uri) async {
|
||||||
try {
|
try {
|
||||||
// ignore: close_sinks
|
// ignore: close_sinks
|
||||||
var ws = await WebSocket.connect(uri.toString());
|
final ws = await WebSocket.connect(uri.toString());
|
||||||
return IOWebSocketChannel(ws);
|
return IOWebSocketChannel(ws);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Future.error(e);
|
return Future.error(e);
|
||||||
|
|||||||
+1
-2
@@ -14,8 +14,7 @@ class ConnectError extends LiveKitError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class UnexpectedConnectionState extends LiveKitError {
|
class UnexpectedConnectionState extends LiveKitError {
|
||||||
UnexpectedConnectionState([String msg = 'Unexpected connection state'])
|
UnexpectedConnectionState([String msg = 'Unexpected connection state']) : super(msg);
|
||||||
: super(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class TrackCreateError extends LiveKitError {
|
class TrackCreateError extends LiveKitError {
|
||||||
|
|||||||
+22
-14
@@ -4,17 +4,16 @@ class RTCConfiguration {
|
|||||||
String? iceTransportPolicy;
|
String? iceTransportPolicy;
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
var iceServersMap = [];
|
final iceServersMap = <Map<String, dynamic>>[];
|
||||||
iceServers?.forEach((element) {
|
for (final element in (iceServers ?? <RTCIceServer>[])) {
|
||||||
iceServersMap.add(element.toMap());
|
iceServersMap.add(element.toMap());
|
||||||
});
|
}
|
||||||
return {
|
return <String, dynamic>{
|
||||||
// only supports unified plan
|
// only supports unified plan
|
||||||
'sdpSemantics': 'unified-plan',
|
'sdpSemantics': 'unified-plan',
|
||||||
if (iceCandidatePoolSize != null)
|
if (iceCandidatePoolSize != null) 'iceCandidatePoolSize': iceCandidatePoolSize,
|
||||||
"iceCandidatePoolSize": iceCandidatePoolSize,
|
'iceServers': iceServersMap,
|
||||||
"iceServers": iceServersMap,
|
if (iceTransportPolicy != null) 'iceTransportPolicy': iceTransportPolicy,
|
||||||
if (iceTransportPolicy != null) "iceTransportPolicy": iceTransportPolicy,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,13 +26,22 @@ class RTCIceServer {
|
|||||||
RTCIceServer({required this.urls, this.username, this.credential});
|
RTCIceServer({required this.urls, this.username, this.credential});
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return <String, dynamic>{
|
||||||
"urls": urls,
|
'urls': urls,
|
||||||
if (username != null) "username": username,
|
if (username != null) 'username': username,
|
||||||
if (credential != null) "credential": credential,
|
if (credential != null) 'credential': credential,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const RTCIceTransportPolicyAll = 'all';
|
enum RTCIceTransportPolicy {
|
||||||
const RTCIceTransportPolicyRelay = 'relay';
|
all,
|
||||||
|
relay,
|
||||||
|
}
|
||||||
|
|
||||||
|
extension RTCIceTransportPolicyExt on RTCIceTransportPolicy {
|
||||||
|
String toStringValue() => {
|
||||||
|
RTCIceTransportPolicy.all: 'all',
|
||||||
|
RTCIceTransportPolicy.relay: 'relay',
|
||||||
|
}[this]!;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import 'options.dart';
|
|||||||
/// {@category Room}
|
/// {@category Room}
|
||||||
class LiveKitClient {
|
class LiveKitClient {
|
||||||
/// Connects to a LiveKit room
|
/// Connects to a LiveKit room
|
||||||
static Future<Room> connect(String url, String token,
|
static Future<Room> connect(String url, String token, [JoinOptions? options]) {
|
||||||
[JoinOptions? options]) {
|
final room = Room();
|
||||||
var room = Room();
|
|
||||||
return room.connect(url, token, options);
|
return room.connect(url, token, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
final logger = Logger("livekit");
|
final logger = Logger('livekit');
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import 'participant.dart';
|
|||||||
|
|
||||||
/// Represents the current participant in the room.
|
/// Represents the current participant in the room.
|
||||||
class LocalParticipant extends Participant {
|
class LocalParticipant extends Participant {
|
||||||
RTCEngine _engine;
|
final RTCEngine _engine;
|
||||||
|
|
||||||
LocalParticipant({
|
LocalParticipant({
|
||||||
required RTCEngine engine,
|
required RTCEngine engine,
|
||||||
@@ -29,15 +29,14 @@ class LocalParticipant extends Participant {
|
|||||||
|
|
||||||
/// publish an audio track to the room
|
/// publish an audio track to the room
|
||||||
Future<TrackPublication> publishAudioTrack(LocalAudioTrack track) async {
|
Future<TrackPublication> publishAudioTrack(LocalAudioTrack track) async {
|
||||||
if (audioTracks.values.any(
|
if (audioTracks.values.any((element) => element.track?.mediaTrack.id == track.mediaTrack.id)) {
|
||||||
(element) => element.track?.mediaTrack.id == track.mediaTrack.id)) {
|
|
||||||
return Future.error(TrackPublishError('track already exists'));
|
return Future.error(TrackPublishError('track already exists'));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var trackInfo = await _engine.addTrack(
|
final trackInfo =
|
||||||
cid: track.getCid(), name: track.name, kind: track.kind);
|
await _engine.addTrack(cid: track.getCid(), name: track.name, kind: track.kind);
|
||||||
var transceiverInit = new RTCRtpTransceiverInit(
|
final transceiverInit = RTCRtpTransceiverInit(
|
||||||
direction: TransceiverDirection.SendOnly,
|
direction: TransceiverDirection.SendOnly,
|
||||||
);
|
);
|
||||||
// addTransceiver cannot pass in a kind parameter due to a bug in flutter-webrtc (web)
|
// addTransceiver cannot pass in a kind parameter due to a bug in flutter-webrtc (web)
|
||||||
@@ -46,7 +45,7 @@ class LocalParticipant extends Participant {
|
|||||||
init: transceiverInit,
|
init: transceiverInit,
|
||||||
);
|
);
|
||||||
|
|
||||||
var pub = new LocalTrackPublication(trackInfo, track, this);
|
final pub = LocalTrackPublication(trackInfo, track, this);
|
||||||
addTrackPublication(pub);
|
addTrackPublication(pub);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
||||||
@@ -58,15 +57,14 @@ class LocalParticipant extends Participant {
|
|||||||
|
|
||||||
/// Publish a video track to the room
|
/// Publish a video track to the room
|
||||||
Future<TrackPublication> publishVideoTrack(LocalVideoTrack track) async {
|
Future<TrackPublication> publishVideoTrack(LocalVideoTrack track) async {
|
||||||
if (videoTracks.values.any(
|
if (videoTracks.values.any((element) => element.track?.mediaTrack.id == track.mediaTrack.id)) {
|
||||||
(element) => element.track?.mediaTrack.id == track.mediaTrack.id)) {
|
|
||||||
return Future.error(TrackPublishError('track already exists'));
|
return Future.error(TrackPublishError('track already exists'));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var trackInfo = await _engine.addTrack(
|
final trackInfo =
|
||||||
cid: track.getCid(), name: track.name, kind: track.kind);
|
await _engine.addTrack(cid: track.getCid(), name: track.name, kind: track.kind);
|
||||||
var transceiverInit = new RTCRtpTransceiverInit(
|
final transceiverInit = RTCRtpTransceiverInit(
|
||||||
direction: TransceiverDirection.SendOnly,
|
direction: TransceiverDirection.SendOnly,
|
||||||
);
|
);
|
||||||
// TODO: video encodings and simulcasts
|
// TODO: video encodings and simulcasts
|
||||||
@@ -76,7 +74,7 @@ class LocalParticipant extends Participant {
|
|||||||
init: transceiverInit,
|
init: transceiverInit,
|
||||||
);
|
);
|
||||||
|
|
||||||
var pub = new LocalTrackPublication(trackInfo, track, this);
|
final pub = LocalTrackPublication(trackInfo, track, this);
|
||||||
addTrackPublication(pub);
|
addTrackPublication(pub);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
||||||
@@ -87,15 +85,15 @@ class LocalParticipant extends Participant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Unpublish a track that's already published
|
/// Unpublish a track that's already published
|
||||||
unpublishTrack(Track track) {
|
void unpublishTrack(Track track) {
|
||||||
var existing = tracks.values.where((element) => element.track == track);
|
final existing = tracks.values.where((element) => element.track == track);
|
||||||
if (existing.isEmpty) {
|
if (existing.isEmpty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var pub = existing.first;
|
final pub = existing.first;
|
||||||
|
|
||||||
track.stop();
|
track.stop();
|
||||||
var sender = track.transceiver?.sender;
|
final sender = track.transceiver?.sender;
|
||||||
if (sender != null) {
|
if (sender != null) {
|
||||||
engine.publisher?.pc.removeTrack(sender);
|
engine.publisher?.pc.removeTrack(sender);
|
||||||
}
|
}
|
||||||
@@ -108,13 +106,14 @@ class LocalParticipant extends Participant {
|
|||||||
case TrackType.VIDEO:
|
case TrackType.VIDEO:
|
||||||
videoTracks.remove(pub.sid);
|
videoTracks.remove(pub.sid);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Publish a new data payload to the room.
|
/// Publish a new data payload to the room.
|
||||||
/// @param destinationSids When empty, data will be forwarded to each participant in the room.
|
/// @param destinationSids When empty, data will be forwarded to each participant in the room.
|
||||||
publishData(List<int> data, DataPacket_Kind reliability,
|
void publishData(List<int> data, DataPacket_Kind reliability, {List<String>? destinationSids}) {
|
||||||
{List<String>? destinationSids}) {
|
|
||||||
RTCDataChannel? channel;
|
RTCDataChannel? channel;
|
||||||
switch (reliability) {
|
switch (reliability) {
|
||||||
case DataPacket_Kind.RELIABLE:
|
case DataPacket_Kind.RELIABLE:
|
||||||
@@ -128,23 +127,23 @@ class LocalParticipant extends Participant {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var packet = new DataPacket(
|
final packet = DataPacket(
|
||||||
kind: reliability,
|
kind: reliability,
|
||||||
user: new UserPacket(
|
user: UserPacket(
|
||||||
payload: data,
|
payload: data,
|
||||||
participantSid: sid,
|
participantSid: sid,
|
||||||
destinationSids: destinationSids,
|
destinationSids: destinationSids,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
var buffer = packet.writeToBuffer();
|
final buffer = packet.writeToBuffer();
|
||||||
channel.send(RTCDataChannelMessage.fromBinary(buffer));
|
channel.send(RTCDataChannelMessage.fromBinary(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// for internal use
|
/// for internal use
|
||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
@override
|
@override
|
||||||
updateFromInfo(ParticipantInfo info) {
|
void updateFromInfo(ParticipantInfo info) {
|
||||||
super.updateFromInfo(info);
|
super.updateFromInfo(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,29 +21,26 @@ mixin ParticipantDelegate {
|
|||||||
void onTrackUnmuted(Participant participant, TrackPublication publication) {}
|
void onTrackUnmuted(Participant participant, TrackPublication publication) {}
|
||||||
|
|
||||||
/// This participant has published a new [Track] to the [Room].
|
/// This participant has published a new [Track] to the [Room].
|
||||||
void onTrackPublished(
|
void onTrackPublished(RemoteParticipant participant, RemoteTrackPublication publication) {}
|
||||||
RemoteParticipant participant, RemoteTrackPublication publication) {}
|
|
||||||
|
|
||||||
/// This participant has unpublished one of their [Track].
|
/// This participant has unpublished one of their [Track].
|
||||||
void onTrackUnpublished(
|
void onTrackUnpublished(RemoteParticipant participant, RemoteTrackPublication publication) {}
|
||||||
RemoteParticipant participant, RemoteTrackPublication publication) {}
|
|
||||||
|
|
||||||
/// The [LocalParticipant] has subscribed to a new track published by this
|
/// The [LocalParticipant] has subscribed to a new track published by this
|
||||||
/// [RemoteParticipant]
|
/// [RemoteParticipant]
|
||||||
void onTrackSubscribed(RemoteParticipant participant, Track track,
|
void onTrackSubscribed(
|
||||||
RemoteTrackPublication publication) {}
|
RemoteParticipant participant, Track track, RemoteTrackPublication publication) {}
|
||||||
|
|
||||||
/// The [LocalParticipant] has unsubscribed from a track published by this
|
/// The [LocalParticipant] has unsubscribed from a track published by this
|
||||||
/// [RemoteParticipant]. This event is fired when the track was unpublished
|
/// [RemoteParticipant]. This event is fired when the track was unpublished
|
||||||
void onTrackUnsubscribed(RemoteParticipant participant, Track track,
|
void onTrackUnsubscribed(
|
||||||
RemoteTrackPublication publication) {}
|
RemoteParticipant participant, Track track, RemoteTrackPublication publication) {}
|
||||||
|
|
||||||
/// Data received from this [RemoteParticipant].
|
/// Data received from this [RemoteParticipant].
|
||||||
void onDataReceived(RemoteParticipant participant, List<int> data) {}
|
void onDataReceived(RemoteParticipant participant, List<int> data) {}
|
||||||
|
|
||||||
/// An error has occured during track subscription.
|
/// An error has occured during track subscription.
|
||||||
void onTrackSubscriptionFailed(
|
void onTrackSubscriptionFailed(RemoteParticipant participant, String sid, String? message) {}
|
||||||
RemoteParticipant participant, String sid, String? message) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents a Participant in the room, notifies changes via delegates as
|
/// Represents a Participant in the room, notifies changes via delegates as
|
||||||
@@ -85,10 +82,9 @@ class Participant extends ChangeNotifier {
|
|||||||
|
|
||||||
/// when the participant joined the room
|
/// when the participant joined the room
|
||||||
DateTime get joinedAt {
|
DateTime get joinedAt {
|
||||||
var pi = _participantInfo;
|
final pi = _participantInfo;
|
||||||
if (pi != null) {
|
if (pi != null) {
|
||||||
return DateTime.fromMillisecondsSinceEpoch(pi.joinedAt.toInt() * 1000,
|
return DateTime.fromMillisecondsSinceEpoch(pi.joinedAt.toInt() * 1000, isUtc: true);
|
||||||
isUtc: true);
|
|
||||||
}
|
}
|
||||||
return DateTime.now();
|
return DateTime.now();
|
||||||
}
|
}
|
||||||
@@ -111,7 +107,7 @@ class Participant extends ChangeNotifier {
|
|||||||
/// tracks that are subscribed to
|
/// tracks that are subscribed to
|
||||||
List<TrackPublication> get subscribedTracks {
|
List<TrackPublication> get subscribedTracks {
|
||||||
List<TrackPublication> result = [];
|
List<TrackPublication> result = [];
|
||||||
for (var track in tracks.values) {
|
for (final track in tracks.values) {
|
||||||
if (track.subscribed) {
|
if (track.subscribed) {
|
||||||
result.add(track);
|
result.add(track);
|
||||||
}
|
}
|
||||||
@@ -140,9 +136,9 @@ class Participant extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
_setMetadata(String md) {
|
void _setMetadata(String md) {
|
||||||
var changed = this._participantInfo?.metadata != md;
|
final changed = _participantInfo?.metadata != md;
|
||||||
this.metadata = md;
|
metadata = md;
|
||||||
if (changed) {
|
if (changed) {
|
||||||
delegate?.onMetadataChanged(this);
|
delegate?.onMetadataChanged(this);
|
||||||
roomDelegate?.onMetadataChanged(this);
|
roomDelegate?.onMetadataChanged(this);
|
||||||
@@ -152,24 +148,24 @@ class Participant extends ChangeNotifier {
|
|||||||
|
|
||||||
/// for internal use
|
/// for internal use
|
||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
updateFromInfo(ParticipantInfo info) {
|
void updateFromInfo(ParticipantInfo info) {
|
||||||
this.identity = info.identity;
|
identity = info.identity;
|
||||||
this.sid = info.sid;
|
sid = info.sid;
|
||||||
if (info.metadata.isNotEmpty) {
|
if (info.metadata.isNotEmpty) {
|
||||||
_setMetadata(info.metadata);
|
_setMetadata(info.metadata);
|
||||||
}
|
}
|
||||||
this._participantInfo = info;
|
_participantInfo = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// for internal use
|
/// for internal use
|
||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
muteChanged() {
|
void muteChanged() {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// for internal use
|
/// for internal use
|
||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
addTrackPublication(TrackPublication pub) {
|
void addTrackPublication(TrackPublication pub) {
|
||||||
pub.track?.sid = pub.sid;
|
pub.track?.sid = pub.sid;
|
||||||
tracks[pub.sid] = pub;
|
tracks[pub.sid] = pub;
|
||||||
switch (pub.kind) {
|
switch (pub.kind) {
|
||||||
|
|||||||
@@ -9,20 +9,18 @@ import 'participant.dart';
|
|||||||
|
|
||||||
/// Represents other participant in the [Room].
|
/// Represents other participant in the [Room].
|
||||||
class RemoteParticipant extends Participant {
|
class RemoteParticipant extends Participant {
|
||||||
SignalClient _client;
|
final SignalClient _client;
|
||||||
|
|
||||||
SignalClient get client => _client;
|
SignalClient get client => _client;
|
||||||
|
|
||||||
RemoteParticipant(this._client, String sid, String identity)
|
RemoteParticipant(this._client, String sid, String identity) : super(sid, identity);
|
||||||
: super(sid, identity);
|
|
||||||
|
|
||||||
RemoteParticipant.fromInfo(this._client, ParticipantInfo info)
|
RemoteParticipant.fromInfo(this._client, ParticipantInfo info) : super(info.sid, info.identity) {
|
||||||
: super(info.sid, info.identity) {
|
|
||||||
updateFromInfo(info);
|
updateFromInfo(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteTrackPublication? getTrackPublication(String sid) {
|
RemoteTrackPublication? getTrackPublication(String sid) {
|
||||||
var pub = tracks[sid];
|
final pub = tracks[sid];
|
||||||
if (pub is RemoteTrackPublication) {
|
if (pub is RemoteTrackPublication) {
|
||||||
return pub;
|
return pub;
|
||||||
}
|
}
|
||||||
@@ -30,10 +28,9 @@ class RemoteParticipant extends Participant {
|
|||||||
|
|
||||||
/// for internal use
|
/// for internal use
|
||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
addSubscribedMediaTrack(
|
void addSubscribedMediaTrack(MediaStreamTrack mediaTrack, MediaStream stream, String? sid) async {
|
||||||
MediaStreamTrack mediaTrack, MediaStream stream, String? sid) async {
|
|
||||||
if (sid == null) {
|
if (sid == null) {
|
||||||
var msg = 'addSubscribedMediaTrack received null sid';
|
const msg = 'addSubscribedMediaTrack received null sid';
|
||||||
delegate?.onTrackSubscriptionFailed(this, '', msg);
|
delegate?.onTrackSubscriptionFailed(this, '', msg);
|
||||||
roomDelegate?.onTrackSubscriptionFailed(this, '', msg);
|
roomDelegate?.onTrackSubscriptionFailed(this, '', msg);
|
||||||
return;
|
return;
|
||||||
@@ -42,9 +39,9 @@ class RemoteParticipant extends Participant {
|
|||||||
var pub = getTrackPublication(sid);
|
var pub = getTrackPublication(sid);
|
||||||
if (pub == null) {
|
if (pub == null) {
|
||||||
// we may have received the track prior to metadata. wait up to 3s
|
// we may have received the track prior to metadata. wait up to 3s
|
||||||
pub = await _waitForTrackPublication(sid, Duration(seconds: 3));
|
pub = await _waitForTrackPublication(sid, const Duration(seconds: 3));
|
||||||
if (pub == null) {
|
if (pub == null) {
|
||||||
var msg = 'no track metadata found';
|
const msg = 'no track metadata found';
|
||||||
delegate?.onTrackSubscriptionFailed(this, sid, msg);
|
delegate?.onTrackSubscriptionFailed(this, sid, msg);
|
||||||
roomDelegate?.onTrackSubscriptionFailed(this, sid, msg);
|
roomDelegate?.onTrackSubscriptionFailed(this, sid, msg);
|
||||||
return;
|
return;
|
||||||
@@ -53,13 +50,13 @@ class RemoteParticipant extends Participant {
|
|||||||
|
|
||||||
Track? track;
|
Track? track;
|
||||||
if (pub.kind == TrackType.AUDIO) {
|
if (pub.kind == TrackType.AUDIO) {
|
||||||
var audioTrack = new AudioTrack(pub.name, mediaTrack, stream);
|
final audioTrack = AudioTrack(pub.name, mediaTrack, stream);
|
||||||
audioTrack.start();
|
audioTrack.start();
|
||||||
track = audioTrack;
|
track = audioTrack;
|
||||||
} else if (pub.kind == TrackType.VIDEO) {
|
} else if (pub.kind == TrackType.VIDEO) {
|
||||||
track = new VideoTrack(pub.name, mediaTrack, stream);
|
track = VideoTrack(pub.name, mediaTrack, stream);
|
||||||
} else {
|
} else {
|
||||||
var msg = 'unsupported track type ${pub.kind}';
|
final msg = 'unsupported track type ${pub.kind}';
|
||||||
delegate?.onTrackSubscriptionFailed(this, sid, msg);
|
delegate?.onTrackSubscriptionFailed(this, sid, msg);
|
||||||
roomDelegate?.onTrackSubscriptionFailed(this, sid, msg);
|
roomDelegate?.onTrackSubscriptionFailed(this, sid, msg);
|
||||||
return;
|
return;
|
||||||
@@ -77,15 +74,15 @@ class RemoteParticipant extends Participant {
|
|||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
@override
|
@override
|
||||||
void updateFromInfo(ParticipantInfo info) {
|
void updateFromInfo(ParticipantInfo info) {
|
||||||
var hadInfo = hasInfo;
|
final hadInfo = hasInfo;
|
||||||
super.updateFromInfo(info);
|
super.updateFromInfo(info);
|
||||||
|
|
||||||
// figuring out deltas between tracks
|
// figuring out deltas between tracks
|
||||||
var validPubs = Map<String, RemoteTrackPublication>();
|
final validPubs = <String, RemoteTrackPublication>{};
|
||||||
var newPubs = Map<String, RemoteTrackPublication>();
|
final newPubs = <String, RemoteTrackPublication>{};
|
||||||
|
|
||||||
for (var info in info.tracks) {
|
for (final info in info.tracks) {
|
||||||
var sid = info.sid;
|
final sid = info.sid;
|
||||||
var pub = getTrackPublication(sid);
|
var pub = getTrackPublication(sid);
|
||||||
|
|
||||||
if (pub == null) {
|
if (pub == null) {
|
||||||
@@ -101,30 +98,30 @@ class RemoteParticipant extends Participant {
|
|||||||
|
|
||||||
// notify listeners when it's not a new participant
|
// notify listeners when it's not a new participant
|
||||||
if (hadInfo) {
|
if (hadInfo) {
|
||||||
for (var pub in newPubs.values) {
|
for (final pub in newPubs.values) {
|
||||||
delegate?.onTrackPublished(this, pub);
|
delegate?.onTrackPublished(this, pub);
|
||||||
roomDelegate?.onTrackPublished(this, pub);
|
roomDelegate?.onTrackPublished(this, pub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove tracks
|
// remove tracks
|
||||||
for (var pub in tracks.values) {
|
for (final pub in tracks.values) {
|
||||||
if (!validPubs.containsKey(pub.sid)) {
|
if (!validPubs.containsKey(pub.sid)) {
|
||||||
unpublishTrack(sid, true);
|
unpublishTrack(sid, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unpublishTrack(String sid, [bool sendUnpublish = false]) {
|
void unpublishTrack(String sid, [bool sendUnpublish = false]) {
|
||||||
var pub = tracks.remove(sid);
|
final pub = tracks.remove(sid);
|
||||||
if (pub == null || !(pub is RemoteTrackPublication)) {
|
if (pub == null || pub is! RemoteTrackPublication) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
audioTracks.remove(sid);
|
audioTracks.remove(sid);
|
||||||
videoTracks.remove(sid);
|
videoTracks.remove(sid);
|
||||||
|
|
||||||
var track = pub.track;
|
final track = pub.track;
|
||||||
if (track != null) {
|
if (track != null) {
|
||||||
track.stop();
|
track.stop();
|
||||||
delegate?.onTrackUnsubscribed(this, track, pub);
|
delegate?.onTrackUnsubscribed(this, track, pub);
|
||||||
@@ -137,12 +134,11 @@ class RemoteParticipant extends Participant {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<RemoteTrackPublication?> _waitForTrackPublication(
|
Future<RemoteTrackPublication?> _waitForTrackPublication(String sid, Duration delay) async {
|
||||||
String sid, Duration delay) async {
|
final endTime = DateTime.now().add(delay);
|
||||||
var endTime = DateTime.now().add(delay);
|
|
||||||
while (DateTime.now().isBefore(endTime)) {
|
while (DateTime.now().isBefore(endTime)) {
|
||||||
var pub = await Future<RemoteTrackPublication?>.delayed(
|
final pub =
|
||||||
Duration(milliseconds: 100), () {
|
await Future<RemoteTrackPublication?>.delayed(const Duration(milliseconds: 100), () {
|
||||||
return getTrackPublication(sid);
|
return getTrackPublication(sid);
|
||||||
});
|
});
|
||||||
if (pub != null) {
|
if (pub != null) {
|
||||||
|
|||||||
@@ -16,35 +16,27 @@ export 'livekit_models.pbenum.dart';
|
|||||||
|
|
||||||
class Room extends $pb.GeneratedMessage {
|
class Room extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Room',
|
||||||
? ''
|
|
||||||
: 'Room',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sid')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'sid')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'name')
|
|
||||||
..a<$core.int>(
|
..a<$core.int>(
|
||||||
3,
|
3,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'emptyTimeout',
|
||||||
? ''
|
|
||||||
: 'emptyTimeout',
|
|
||||||
$pb.PbFieldType.OU3)
|
$pb.PbFieldType.OU3)
|
||||||
..a<$core.int>(
|
..a<$core.int>(
|
||||||
4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxParticipants', $pb.PbFieldType.OU3)
|
4,
|
||||||
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxParticipants',
|
||||||
|
$pb.PbFieldType.OU3)
|
||||||
..aInt64(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'creationTime')
|
..aInt64(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'creationTime')
|
||||||
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'turnPassword')
|
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'turnPassword')
|
||||||
..pc<Codec>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'enabledCodecs', $pb.PbFieldType.PM, subBuilder: Codec.create)
|
..pc<Codec>(
|
||||||
|
7,
|
||||||
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'enabledCodecs',
|
||||||
|
$pb.PbFieldType.PM,
|
||||||
|
subBuilder: Codec.create)
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
Room._() : super();
|
Room._() : super();
|
||||||
@@ -84,8 +76,7 @@ class Room extends $pb.GeneratedMessage {
|
|||||||
factory Room.fromBuffer($core.List<$core.int> i,
|
factory Room.fromBuffer($core.List<$core.int> i,
|
||||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
create()..mergeFromBuffer(i, r);
|
create()..mergeFromBuffer(i, r);
|
||||||
factory Room.fromJson($core.String i,
|
factory Room.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
|
||||||
create()..mergeFromJson(i, r);
|
create()..mergeFromJson(i, r);
|
||||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||||
@@ -103,8 +94,7 @@ class Room extends $pb.GeneratedMessage {
|
|||||||
Room createEmptyInstance() => create();
|
Room createEmptyInstance() => create();
|
||||||
static $pb.PbList<Room> createRepeated() => $pb.PbList<Room>();
|
static $pb.PbList<Room> createRepeated() => $pb.PbList<Room>();
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static Room getDefault() =>
|
static Room getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Room>(create);
|
||||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Room>(create);
|
|
||||||
static Room? _defaultInstance;
|
static Room? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -185,24 +175,12 @@ class Room extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class Codec extends $pb.GeneratedMessage {
|
class Codec extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Codec',
|
||||||
? ''
|
|
||||||
: 'Codec',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mime')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fmtpLine')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'mime')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'fmtpLine')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
Codec._() : super();
|
Codec._() : super();
|
||||||
@@ -222,8 +200,7 @@ class Codec extends $pb.GeneratedMessage {
|
|||||||
factory Codec.fromBuffer($core.List<$core.int> i,
|
factory Codec.fromBuffer($core.List<$core.int> i,
|
||||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
create()..mergeFromBuffer(i, r);
|
create()..mergeFromBuffer(i, r);
|
||||||
factory Codec.fromJson($core.String i,
|
factory Codec.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
|
||||||
create()..mergeFromJson(i, r);
|
create()..mergeFromJson(i, r);
|
||||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||||
@@ -272,30 +249,23 @@ class Codec extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class ParticipantInfo extends $pb.GeneratedMessage {
|
class ParticipantInfo extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ParticipantInfo',
|
||||||
? ''
|
|
||||||
: 'ParticipantInfo',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sid')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'identity')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'sid')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'identity')
|
|
||||||
..e<ParticipantInfo_State>(
|
..e<ParticipantInfo_State>(
|
||||||
3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'state', $pb.PbFieldType.OE,
|
3,
|
||||||
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'state',
|
||||||
|
$pb.PbFieldType.OE,
|
||||||
defaultOrMaker: ParticipantInfo_State.JOINING,
|
defaultOrMaker: ParticipantInfo_State.JOINING,
|
||||||
valueOf: ParticipantInfo_State.valueOf,
|
valueOf: ParticipantInfo_State.valueOf,
|
||||||
enumValues: ParticipantInfo_State.values)
|
enumValues: ParticipantInfo_State.values)
|
||||||
..pc<TrackInfo>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tracks', $pb.PbFieldType.PM,
|
..pc<TrackInfo>(
|
||||||
|
4,
|
||||||
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tracks',
|
||||||
|
$pb.PbFieldType.PM,
|
||||||
subBuilder: TrackInfo.create)
|
subBuilder: TrackInfo.create)
|
||||||
..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'metadata')
|
..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'metadata')
|
||||||
..aInt64(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'joinedAt')
|
..aInt64(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'joinedAt')
|
||||||
@@ -356,11 +326,10 @@ class ParticipantInfo extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static ParticipantInfo create() => ParticipantInfo._();
|
static ParticipantInfo create() => ParticipantInfo._();
|
||||||
ParticipantInfo createEmptyInstance() => create();
|
ParticipantInfo createEmptyInstance() => create();
|
||||||
static $pb.PbList<ParticipantInfo> createRepeated() =>
|
static $pb.PbList<ParticipantInfo> createRepeated() => $pb.PbList<ParticipantInfo>();
|
||||||
$pb.PbList<ParticipantInfo>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static ParticipantInfo getDefault() => _defaultInstance ??=
|
static ParticipantInfo getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<ParticipantInfo>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ParticipantInfo>(create);
|
||||||
static ParticipantInfo? _defaultInstance;
|
static ParticipantInfo? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -441,33 +410,20 @@ class ParticipantInfo extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class TrackInfo extends $pb.GeneratedMessage {
|
class TrackInfo extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TrackInfo',
|
||||||
? ''
|
|
||||||
: 'TrackInfo',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sid')
|
||||||
1,
|
..e<TrackType>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'type',
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'sid')
|
|
||||||
..e<TrackType>(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'type',
|
|
||||||
$pb.PbFieldType.OE,
|
$pb.PbFieldType.OE,
|
||||||
defaultOrMaker: TrackType.AUDIO,
|
defaultOrMaker: TrackType.AUDIO, valueOf: TrackType.valueOf, enumValues: TrackType.values)
|
||||||
valueOf: TrackType.valueOf,
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
||||||
enumValues: TrackType.values)
|
|
||||||
..aOS(
|
|
||||||
3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
|
||||||
..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'muted')
|
..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'muted')
|
||||||
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width', $pb.PbFieldType.OU3)
|
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width',
|
||||||
..a<$core.int>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.OU3)
|
$pb.PbFieldType.OU3)
|
||||||
|
..a<$core.int>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height',
|
||||||
|
$pb.PbFieldType.OU3)
|
||||||
..aOB(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'simulcast')
|
..aOB(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'simulcast')
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
@@ -619,32 +575,21 @@ class TrackInfo extends $pb.GeneratedMessage {
|
|||||||
enum DataMessage_Value { text, binary, notSet }
|
enum DataMessage_Value { text, binary, notSet }
|
||||||
|
|
||||||
class DataMessage extends $pb.GeneratedMessage {
|
class DataMessage extends $pb.GeneratedMessage {
|
||||||
static const $core.Map<$core.int, DataMessage_Value> _DataMessage_ValueByTag =
|
static const $core.Map<$core.int, DataMessage_Value> _DataMessage_ValueByTag = {
|
||||||
{
|
|
||||||
1: DataMessage_Value.text,
|
1: DataMessage_Value.text,
|
||||||
2: DataMessage_Value.binary,
|
2: DataMessage_Value.binary,
|
||||||
0: DataMessage_Value.notSet
|
0: DataMessage_Value.notSet
|
||||||
};
|
};
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DataMessage',
|
||||||
? ''
|
|
||||||
: 'DataMessage',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..oo(0, [1, 2])
|
..oo(0, [1, 2])
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'text')
|
||||||
1,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'text')
|
|
||||||
..a<$core.List<$core.int>>(
|
..a<$core.List<$core.int>>(
|
||||||
2,
|
2,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'binary',
|
||||||
? ''
|
|
||||||
: 'binary',
|
|
||||||
$pb.PbFieldType.OY)
|
$pb.PbFieldType.OY)
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
@@ -684,8 +629,8 @@ class DataMessage extends $pb.GeneratedMessage {
|
|||||||
DataMessage createEmptyInstance() => create();
|
DataMessage createEmptyInstance() => create();
|
||||||
static $pb.PbList<DataMessage> createRepeated() => $pb.PbList<DataMessage>();
|
static $pb.PbList<DataMessage> createRepeated() => $pb.PbList<DataMessage>();
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static DataMessage getDefault() => _defaultInstance ??=
|
static DataMessage getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<DataMessage>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DataMessage>(create);
|
||||||
static DataMessage? _defaultInstance;
|
static DataMessage? _defaultInstance;
|
||||||
|
|
||||||
DataMessage_Value whichValue() => _DataMessage_ValueByTag[$_whichOneof(0)]!;
|
DataMessage_Value whichValue() => _DataMessage_ValueByTag[$_whichOneof(0)]!;
|
||||||
@@ -718,30 +663,20 @@ class DataMessage extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class RecordingInput extends $pb.GeneratedMessage {
|
class RecordingInput extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RecordingInput',
|
||||||
? ''
|
|
||||||
: 'RecordingInput',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'url')
|
||||||
1,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'url')
|
|
||||||
..aOM<RecordingTemplate>(
|
..aOM<RecordingTemplate>(
|
||||||
2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'template',
|
2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'template',
|
||||||
subBuilder: RecordingTemplate.create)
|
subBuilder: RecordingTemplate.create)
|
||||||
..a<$core.int>(
|
..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width',
|
||||||
3,
|
$pb.PbFieldType.O3)
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height',
|
||||||
? ''
|
$pb.PbFieldType.O3)
|
||||||
: 'width',
|
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'depth',
|
||||||
$pb.PbFieldType.O3)
|
$pb.PbFieldType.O3)
|
||||||
..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.O3)
|
|
||||||
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'depth', $pb.PbFieldType.O3)
|
|
||||||
..a<$core.int>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'framerate', $pb.PbFieldType.O3)
|
..a<$core.int>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'framerate', $pb.PbFieldType.O3)
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
@@ -795,11 +730,10 @@ class RecordingInput extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static RecordingInput create() => RecordingInput._();
|
static RecordingInput create() => RecordingInput._();
|
||||||
RecordingInput createEmptyInstance() => create();
|
RecordingInput createEmptyInstance() => create();
|
||||||
static $pb.PbList<RecordingInput> createRepeated() =>
|
static $pb.PbList<RecordingInput> createRepeated() => $pb.PbList<RecordingInput>();
|
||||||
$pb.PbList<RecordingInput>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static RecordingInput getDefault() => _defaultInstance ??=
|
static RecordingInput getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<RecordingInput>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RecordingInput>(create);
|
||||||
static RecordingInput? _defaultInstance;
|
static RecordingInput? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -879,31 +813,14 @@ class RecordingInput extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class RecordingTemplate extends $pb.GeneratedMessage {
|
class RecordingTemplate extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RecordingTemplate',
|
||||||
? ''
|
|
||||||
: 'RecordingTemplate',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'type')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'wsUrl')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'token')
|
||||||
? ''
|
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'roomName')
|
||||||
: 'type')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'wsUrl')
|
|
||||||
..aOS(
|
|
||||||
3,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'token')
|
|
||||||
..aOS(4,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'roomName')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
RecordingTemplate._() : super();
|
RecordingTemplate._() : super();
|
||||||
@@ -948,11 +865,10 @@ class RecordingTemplate extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static RecordingTemplate create() => RecordingTemplate._();
|
static RecordingTemplate create() => RecordingTemplate._();
|
||||||
RecordingTemplate createEmptyInstance() => create();
|
RecordingTemplate createEmptyInstance() => create();
|
||||||
static $pb.PbList<RecordingTemplate> createRepeated() =>
|
static $pb.PbList<RecordingTemplate> createRepeated() => $pb.PbList<RecordingTemplate>();
|
||||||
$pb.PbList<RecordingTemplate>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static RecordingTemplate getDefault() => _defaultInstance ??=
|
static RecordingTemplate getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<RecordingTemplate>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RecordingTemplate>(create);
|
||||||
static RecordingTemplate? _defaultInstance;
|
static RecordingTemplate? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1006,31 +922,19 @@ class RecordingTemplate extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class RecordingOutput extends $pb.GeneratedMessage {
|
class RecordingOutput extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RecordingOutput',
|
||||||
? ''
|
package: const $pb.PackageName(
|
||||||
: 'RecordingOutput',
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'file')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rtmp')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'file')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'rtmp')
|
|
||||||
..aOM<RecordingS3Output>(
|
..aOM<RecordingS3Output>(
|
||||||
3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 's3',
|
3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 's3',
|
||||||
subBuilder: RecordingS3Output.create)
|
subBuilder: RecordingS3Output.create)
|
||||||
..a<$core.int>(
|
..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width',
|
||||||
4,
|
$pb.PbFieldType.O3)
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width',
|
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height',
|
||||||
$pb.PbFieldType.O3)
|
$pb.PbFieldType.O3)
|
||||||
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.O3)
|
|
||||||
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'audioBitrate')
|
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'audioBitrate')
|
||||||
..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'audioFrequency')
|
..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'audioFrequency')
|
||||||
..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'videoBitrate')
|
..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'videoBitrate')
|
||||||
@@ -1099,11 +1003,10 @@ class RecordingOutput extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static RecordingOutput create() => RecordingOutput._();
|
static RecordingOutput create() => RecordingOutput._();
|
||||||
RecordingOutput createEmptyInstance() => create();
|
RecordingOutput createEmptyInstance() => create();
|
||||||
static $pb.PbList<RecordingOutput> createRepeated() =>
|
static $pb.PbList<RecordingOutput> createRepeated() => $pb.PbList<RecordingOutput>();
|
||||||
$pb.PbList<RecordingOutput>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static RecordingOutput getDefault() => _defaultInstance ??=
|
static RecordingOutput getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<RecordingOutput>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RecordingOutput>(create);
|
||||||
static RecordingOutput? _defaultInstance;
|
static RecordingOutput? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1219,31 +1122,14 @@ class RecordingOutput extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class RecordingS3Output extends $pb.GeneratedMessage {
|
class RecordingS3Output extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RecordingS3Output',
|
||||||
? ''
|
|
||||||
: 'RecordingS3Output',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'bucket')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'key')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'accessKey')
|
||||||
? ''
|
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'secret')
|
||||||
: 'bucket')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'key')
|
|
||||||
..aOS(
|
|
||||||
3,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'accessKey')
|
|
||||||
..aOS(4,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'secret')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
RecordingS3Output._() : super();
|
RecordingS3Output._() : super();
|
||||||
@@ -1288,11 +1174,10 @@ class RecordingS3Output extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static RecordingS3Output create() => RecordingS3Output._();
|
static RecordingS3Output create() => RecordingS3Output._();
|
||||||
RecordingS3Output createEmptyInstance() => create();
|
RecordingS3Output createEmptyInstance() => create();
|
||||||
static $pb.PbList<RecordingS3Output> createRepeated() =>
|
static $pb.PbList<RecordingS3Output> createRepeated() => $pb.PbList<RecordingS3Output>();
|
||||||
$pb.PbList<RecordingS3Output>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static RecordingS3Output getDefault() => _defaultInstance ??=
|
static RecordingS3Output getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<RecordingS3Output>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RecordingS3Output>(create);
|
||||||
static RecordingS3Output? _defaultInstance;
|
static RecordingS3Output? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
|
|||||||
@@ -10,21 +10,12 @@ import 'dart:core' as $core;
|
|||||||
import 'package:protobuf/protobuf.dart' as $pb;
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
class TrackType extends $pb.ProtobufEnum {
|
class TrackType extends $pb.ProtobufEnum {
|
||||||
static const TrackType AUDIO = TrackType._(
|
static const TrackType AUDIO =
|
||||||
0,
|
TrackType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'AUDIO');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
static const TrackType VIDEO =
|
||||||
? ''
|
TrackType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'VIDEO');
|
||||||
: 'AUDIO');
|
static const TrackType DATA =
|
||||||
static const TrackType VIDEO = TrackType._(
|
TrackType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA');
|
||||||
1,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'VIDEO');
|
|
||||||
static const TrackType DATA = TrackType._(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'DATA');
|
|
||||||
|
|
||||||
static const $core.List<TrackType> values = <TrackType>[
|
static const $core.List<TrackType> values = <TrackType>[
|
||||||
AUDIO,
|
AUDIO,
|
||||||
@@ -32,8 +23,7 @@ class TrackType extends $pb.ProtobufEnum {
|
|||||||
DATA,
|
DATA,
|
||||||
];
|
];
|
||||||
|
|
||||||
static final $core.Map<$core.int, TrackType> _byValue =
|
static final $core.Map<$core.int, TrackType> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||||
$pb.ProtobufEnum.initByValue(values);
|
|
||||||
static TrackType? valueOf($core.int value) => _byValue[value];
|
static TrackType? valueOf($core.int value) => _byValue[value];
|
||||||
|
|
||||||
const TrackType._($core.int v, $core.String n) : super(v, n);
|
const TrackType._($core.int v, $core.String n) : super(v, n);
|
||||||
@@ -41,28 +31,15 @@ class TrackType extends $pb.ProtobufEnum {
|
|||||||
|
|
||||||
class ParticipantInfo_State extends $pb.ProtobufEnum {
|
class ParticipantInfo_State extends $pb.ProtobufEnum {
|
||||||
static const ParticipantInfo_State JOINING = ParticipantInfo_State._(
|
static const ParticipantInfo_State JOINING = ParticipantInfo_State._(
|
||||||
0,
|
0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'JOINING');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'JOINING');
|
|
||||||
static const ParticipantInfo_State JOINED = ParticipantInfo_State._(
|
static const ParticipantInfo_State JOINED = ParticipantInfo_State._(
|
||||||
1,
|
1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'JOINED');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'JOINED');
|
|
||||||
static const ParticipantInfo_State ACTIVE = ParticipantInfo_State._(
|
static const ParticipantInfo_State ACTIVE = ParticipantInfo_State._(
|
||||||
2,
|
2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ACTIVE');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'ACTIVE');
|
|
||||||
static const ParticipantInfo_State DISCONNECTED = ParticipantInfo_State._(
|
static const ParticipantInfo_State DISCONNECTED = ParticipantInfo_State._(
|
||||||
3,
|
3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DISCONNECTED');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'DISCONNECTED');
|
|
||||||
|
|
||||||
static const $core.List<ParticipantInfo_State> values =
|
static const $core.List<ParticipantInfo_State> values = <ParticipantInfo_State>[
|
||||||
<ParticipantInfo_State>[
|
|
||||||
JOINING,
|
JOINING,
|
||||||
JOINED,
|
JOINED,
|
||||||
ACTIVE,
|
ACTIVE,
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ const TrackType$json = const {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `TrackType`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
/// Descriptor for `TrackType`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||||
final $typed_data.Uint8List trackTypeDescriptor = $convert.base64Decode(
|
final $typed_data.Uint8List trackTypeDescriptor =
|
||||||
'CglUcmFja1R5cGUSCQoFQVVESU8QABIJCgVWSURFTxABEggKBERBVEEQAg==');
|
$convert.base64Decode('CglUcmFja1R5cGUSCQoFQVVESU8QABIJCgVWSURFTxABEggKBERBVEEQAg==');
|
||||||
@$core.Deprecated('Use roomDescriptor instead')
|
@$core.Deprecated('Use roomDescriptor instead')
|
||||||
const Room$json = const {
|
const Room$json = const {
|
||||||
'1': 'Room',
|
'1': 'Room',
|
||||||
@@ -29,13 +29,7 @@ const Room$json = const {
|
|||||||
const {'1': 'sid', '3': 1, '4': 1, '5': 9, '10': 'sid'},
|
const {'1': 'sid', '3': 1, '4': 1, '5': 9, '10': 'sid'},
|
||||||
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
|
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
|
||||||
const {'1': 'empty_timeout', '3': 3, '4': 1, '5': 13, '10': 'emptyTimeout'},
|
const {'1': 'empty_timeout', '3': 3, '4': 1, '5': 13, '10': 'emptyTimeout'},
|
||||||
const {
|
const {'1': 'max_participants', '3': 4, '4': 1, '5': 13, '10': 'maxParticipants'},
|
||||||
'1': 'max_participants',
|
|
||||||
'3': 4,
|
|
||||||
'4': 1,
|
|
||||||
'5': 13,
|
|
||||||
'10': 'maxParticipants'
|
|
||||||
},
|
|
||||||
const {'1': 'creation_time', '3': 5, '4': 1, '5': 3, '10': 'creationTime'},
|
const {'1': 'creation_time', '3': 5, '4': 1, '5': 3, '10': 'creationTime'},
|
||||||
const {'1': 'turn_password', '3': 6, '4': 1, '5': 9, '10': 'turnPassword'},
|
const {'1': 'turn_password', '3': 6, '4': 1, '5': 9, '10': 'turnPassword'},
|
||||||
const {
|
const {
|
||||||
@@ -62,8 +56,8 @@ const Codec$json = const {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `Codec`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `Codec`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List codecDescriptor = $convert.base64Decode(
|
final $typed_data.Uint8List codecDescriptor = $convert
|
||||||
'CgVDb2RlYxISCgRtaW1lGAEgASgJUgRtaW1lEhsKCWZtdHBfbGluZRgCIAEoCVIIZm10cExpbmU=');
|
.base64Decode('CgVDb2RlYxISCgRtaW1lGAEgASgJUgRtaW1lEhsKCWZtdHBfbGluZRgCIAEoCVIIZm10cExpbmU=');
|
||||||
@$core.Deprecated('Use participantInfoDescriptor instead')
|
@$core.Deprecated('Use participantInfoDescriptor instead')
|
||||||
const ParticipantInfo$json = const {
|
const ParticipantInfo$json = const {
|
||||||
'1': 'ParticipantInfo',
|
'1': 'ParticipantInfo',
|
||||||
@@ -78,14 +72,7 @@ const ParticipantInfo$json = const {
|
|||||||
'6': '.livekit.ParticipantInfo.State',
|
'6': '.livekit.ParticipantInfo.State',
|
||||||
'10': 'state'
|
'10': 'state'
|
||||||
},
|
},
|
||||||
const {
|
const {'1': 'tracks', '3': 4, '4': 3, '5': 11, '6': '.livekit.TrackInfo', '10': 'tracks'},
|
||||||
'1': 'tracks',
|
|
||||||
'3': 4,
|
|
||||||
'4': 3,
|
|
||||||
'5': 11,
|
|
||||||
'6': '.livekit.TrackInfo',
|
|
||||||
'10': 'tracks'
|
|
||||||
},
|
|
||||||
const {'1': 'metadata', '3': 5, '4': 1, '5': 9, '10': 'metadata'},
|
const {'1': 'metadata', '3': 5, '4': 1, '5': 9, '10': 'metadata'},
|
||||||
const {'1': 'joined_at', '3': 6, '4': 1, '5': 3, '10': 'joinedAt'},
|
const {'1': 'joined_at', '3': 6, '4': 1, '5': 3, '10': 'joinedAt'},
|
||||||
const {'1': 'hidden', '3': 7, '4': 1, '5': 8, '10': 'hidden'},
|
const {'1': 'hidden', '3': 7, '4': 1, '5': 8, '10': 'hidden'},
|
||||||
@@ -112,14 +99,7 @@ const TrackInfo$json = const {
|
|||||||
'1': 'TrackInfo',
|
'1': 'TrackInfo',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {'1': 'sid', '3': 1, '4': 1, '5': 9, '10': 'sid'},
|
const {'1': 'sid', '3': 1, '4': 1, '5': 9, '10': 'sid'},
|
||||||
const {
|
const {'1': 'type', '3': 2, '4': 1, '5': 14, '6': '.livekit.TrackType', '10': 'type'},
|
||||||
'1': 'type',
|
|
||||||
'3': 2,
|
|
||||||
'4': 1,
|
|
||||||
'5': 14,
|
|
||||||
'6': '.livekit.TrackType',
|
|
||||||
'10': 'type'
|
|
||||||
},
|
|
||||||
const {'1': 'name', '3': 3, '4': 1, '5': 9, '10': 'name'},
|
const {'1': 'name', '3': 3, '4': 1, '5': 9, '10': 'name'},
|
||||||
const {'1': 'muted', '3': 4, '4': 1, '5': 8, '10': 'muted'},
|
const {'1': 'muted', '3': 4, '4': 1, '5': 8, '10': 'muted'},
|
||||||
const {'1': 'width', '3': 5, '4': 1, '5': 13, '10': 'width'},
|
const {'1': 'width', '3': 5, '4': 1, '5': 13, '10': 'width'},
|
||||||
@@ -189,24 +169,11 @@ const RecordingOutput$json = const {
|
|||||||
'2': const [
|
'2': const [
|
||||||
const {'1': 'file', '3': 1, '4': 1, '5': 9, '10': 'file'},
|
const {'1': 'file', '3': 1, '4': 1, '5': 9, '10': 'file'},
|
||||||
const {'1': 'rtmp', '3': 2, '4': 1, '5': 9, '10': 'rtmp'},
|
const {'1': 'rtmp', '3': 2, '4': 1, '5': 9, '10': 'rtmp'},
|
||||||
const {
|
const {'1': 's3', '3': 3, '4': 1, '5': 11, '6': '.livekit.RecordingS3Output', '10': 's3'},
|
||||||
'1': 's3',
|
|
||||||
'3': 3,
|
|
||||||
'4': 1,
|
|
||||||
'5': 11,
|
|
||||||
'6': '.livekit.RecordingS3Output',
|
|
||||||
'10': 's3'
|
|
||||||
},
|
|
||||||
const {'1': 'width', '3': 4, '4': 1, '5': 5, '10': 'width'},
|
const {'1': 'width', '3': 4, '4': 1, '5': 5, '10': 'width'},
|
||||||
const {'1': 'height', '3': 5, '4': 1, '5': 5, '10': 'height'},
|
const {'1': 'height', '3': 5, '4': 1, '5': 5, '10': 'height'},
|
||||||
const {'1': 'audio_bitrate', '3': 6, '4': 1, '5': 9, '10': 'audioBitrate'},
|
const {'1': 'audio_bitrate', '3': 6, '4': 1, '5': 9, '10': 'audioBitrate'},
|
||||||
const {
|
const {'1': 'audio_frequency', '3': 7, '4': 1, '5': 9, '10': 'audioFrequency'},
|
||||||
'1': 'audio_frequency',
|
|
||||||
'3': 7,
|
|
||||||
'4': 1,
|
|
||||||
'5': 9,
|
|
||||||
'10': 'audioFrequency'
|
|
||||||
},
|
|
||||||
const {'1': 'video_bitrate', '3': 8, '4': 1, '5': 9, '10': 'videoBitrate'},
|
const {'1': 'video_bitrate', '3': 8, '4': 1, '5': 9, '10': 'videoBitrate'},
|
||||||
const {'1': 'video_buffer', '3': 9, '4': 1, '5': 9, '10': 'videoBuffer'},
|
const {'1': 'video_buffer', '3': 9, '4': 1, '5': 9, '10': 'videoBuffer'},
|
||||||
],
|
],
|
||||||
|
|||||||
+144
-321
@@ -30,8 +30,7 @@ enum SignalRequest_Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SignalRequest extends $pb.GeneratedMessage {
|
class SignalRequest extends $pb.GeneratedMessage {
|
||||||
static const $core.Map<$core.int, SignalRequest_Message>
|
static const $core.Map<$core.int, SignalRequest_Message> _SignalRequest_MessageByTag = {
|
||||||
_SignalRequest_MessageByTag = {
|
|
||||||
1: SignalRequest_Message.offer,
|
1: SignalRequest_Message.offer,
|
||||||
2: SignalRequest_Message.answer,
|
2: SignalRequest_Message.answer,
|
||||||
3: SignalRequest_Message.trickle,
|
3: SignalRequest_Message.trickle,
|
||||||
@@ -43,26 +42,24 @@ class SignalRequest extends $pb.GeneratedMessage {
|
|||||||
9: SignalRequest_Message.simulcast,
|
9: SignalRequest_Message.simulcast,
|
||||||
0: SignalRequest_Message.notSet
|
0: SignalRequest_Message.notSet
|
||||||
};
|
};
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignalRequest',
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignalRequest',
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..oo(0, [1, 2, 3, 4, 5, 6, 7, 8, 9])
|
..oo(0, [1, 2, 3, 4, 5, 6, 7, 8, 9])
|
||||||
..aOM<SessionDescription>(
|
..aOM<SessionDescription>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offer',
|
||||||
1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offer',
|
|
||||||
subBuilder: SessionDescription.create)
|
subBuilder: SessionDescription.create)
|
||||||
..aOM<SessionDescription>(
|
..aOM<SessionDescription>(
|
||||||
2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'answer',
|
2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'answer',
|
||||||
subBuilder: SessionDescription.create)
|
subBuilder: SessionDescription.create)
|
||||||
..aOM<TrickleRequest>(
|
..aOM<TrickleRequest>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trickle',
|
||||||
3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trickle',
|
|
||||||
subBuilder: TrickleRequest.create)
|
subBuilder: TrickleRequest.create)
|
||||||
..aOM<AddTrackRequest>(
|
..aOM<AddTrackRequest>(
|
||||||
4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'addTrack',
|
4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'addTrack',
|
||||||
subBuilder: AddTrackRequest.create)
|
subBuilder: AddTrackRequest.create)
|
||||||
..aOM<MuteTrackRequest>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mute', subBuilder: MuteTrackRequest.create)
|
..aOM<MuteTrackRequest>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mute',
|
||||||
|
subBuilder: MuteTrackRequest.create)
|
||||||
..aOM<UpdateSubscription>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'subscription', subBuilder: UpdateSubscription.create)
|
..aOM<UpdateSubscription>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'subscription', subBuilder: UpdateSubscription.create)
|
||||||
..aOM<UpdateTrackSettings>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trackSetting', subBuilder: UpdateTrackSettings.create)
|
..aOM<UpdateTrackSettings>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trackSetting', subBuilder: UpdateTrackSettings.create)
|
||||||
..aOM<LeaveRequest>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'leave', subBuilder: LeaveRequest.create)
|
..aOM<LeaveRequest>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'leave', subBuilder: LeaveRequest.create)
|
||||||
@@ -131,15 +128,13 @@ class SignalRequest extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SignalRequest create() => SignalRequest._();
|
static SignalRequest create() => SignalRequest._();
|
||||||
SignalRequest createEmptyInstance() => create();
|
SignalRequest createEmptyInstance() => create();
|
||||||
static $pb.PbList<SignalRequest> createRepeated() =>
|
static $pb.PbList<SignalRequest> createRepeated() => $pb.PbList<SignalRequest>();
|
||||||
$pb.PbList<SignalRequest>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SignalRequest getDefault() => _defaultInstance ??=
|
static SignalRequest getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<SignalRequest>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignalRequest>(create);
|
||||||
static SignalRequest? _defaultInstance;
|
static SignalRequest? _defaultInstance;
|
||||||
|
|
||||||
SignalRequest_Message whichMessage() =>
|
SignalRequest_Message whichMessage() => _SignalRequest_MessageByTag[$_whichOneof(0)]!;
|
||||||
_SignalRequest_MessageByTag[$_whichOneof(0)]!;
|
|
||||||
void clearMessage() => clearField($_whichOneof(0));
|
void clearMessage() => clearField($_whichOneof(0));
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -282,8 +277,7 @@ enum SignalResponse_Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SignalResponse extends $pb.GeneratedMessage {
|
class SignalResponse extends $pb.GeneratedMessage {
|
||||||
static const $core.Map<$core.int, SignalResponse_Message>
|
static const $core.Map<$core.int, SignalResponse_Message> _SignalResponse_MessageByTag = {
|
||||||
_SignalResponse_MessageByTag = {
|
|
||||||
1: SignalResponse_Message.join,
|
1: SignalResponse_Message.join,
|
||||||
2: SignalResponse_Message.answer,
|
2: SignalResponse_Message.answer,
|
||||||
3: SignalResponse_Message.offer,
|
3: SignalResponse_Message.offer,
|
||||||
@@ -294,26 +288,24 @@ class SignalResponse extends $pb.GeneratedMessage {
|
|||||||
8: SignalResponse_Message.leave,
|
8: SignalResponse_Message.leave,
|
||||||
0: SignalResponse_Message.notSet
|
0: SignalResponse_Message.notSet
|
||||||
};
|
};
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignalResponse',
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignalResponse',
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..oo(0, [1, 2, 3, 4, 5, 6, 7, 8])
|
..oo(0, [1, 2, 3, 4, 5, 6, 7, 8])
|
||||||
..aOM<JoinResponse>(
|
..aOM<JoinResponse>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'join',
|
||||||
1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'join',
|
|
||||||
subBuilder: JoinResponse.create)
|
subBuilder: JoinResponse.create)
|
||||||
..aOM<SessionDescription>(
|
..aOM<SessionDescription>(
|
||||||
2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'answer',
|
2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'answer',
|
||||||
subBuilder: SessionDescription.create)
|
subBuilder: SessionDescription.create)
|
||||||
..aOM<SessionDescription>(
|
..aOM<SessionDescription>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offer',
|
||||||
3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offer',
|
|
||||||
subBuilder: SessionDescription.create)
|
subBuilder: SessionDescription.create)
|
||||||
..aOM<TrickleRequest>(
|
..aOM<TrickleRequest>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trickle',
|
||||||
4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trickle',
|
|
||||||
subBuilder: TrickleRequest.create)
|
subBuilder: TrickleRequest.create)
|
||||||
..aOM<ParticipantUpdate>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'update', subBuilder: ParticipantUpdate.create)
|
..aOM<ParticipantUpdate>(
|
||||||
|
5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'update',
|
||||||
|
subBuilder: ParticipantUpdate.create)
|
||||||
..aOM<TrackPublishedResponse>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trackPublished', subBuilder: TrackPublishedResponse.create)
|
..aOM<TrackPublishedResponse>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trackPublished', subBuilder: TrackPublishedResponse.create)
|
||||||
..aOM<ActiveSpeakerUpdate>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'speaker', subBuilder: ActiveSpeakerUpdate.create)
|
..aOM<ActiveSpeakerUpdate>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'speaker', subBuilder: ActiveSpeakerUpdate.create)
|
||||||
..aOM<LeaveRequest>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'leave', subBuilder: LeaveRequest.create)
|
..aOM<LeaveRequest>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'leave', subBuilder: LeaveRequest.create)
|
||||||
@@ -377,15 +369,13 @@ class SignalResponse extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SignalResponse create() => SignalResponse._();
|
static SignalResponse create() => SignalResponse._();
|
||||||
SignalResponse createEmptyInstance() => create();
|
SignalResponse createEmptyInstance() => create();
|
||||||
static $pb.PbList<SignalResponse> createRepeated() =>
|
static $pb.PbList<SignalResponse> createRepeated() => $pb.PbList<SignalResponse>();
|
||||||
$pb.PbList<SignalResponse>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SignalResponse getDefault() => _defaultInstance ??=
|
static SignalResponse getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<SignalResponse>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignalResponse>(create);
|
||||||
static SignalResponse? _defaultInstance;
|
static SignalResponse? _defaultInstance;
|
||||||
|
|
||||||
SignalResponse_Message whichMessage() =>
|
SignalResponse_Message whichMessage() => _SignalResponse_MessageByTag[$_whichOneof(0)]!;
|
||||||
_SignalResponse_MessageByTag[$_whichOneof(0)]!;
|
|
||||||
void clearMessage() => clearField($_whichOneof(0));
|
void clearMessage() => clearField($_whichOneof(0));
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -503,35 +493,23 @@ class SignalResponse extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class AddTrackRequest extends $pb.GeneratedMessage {
|
class AddTrackRequest extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AddTrackRequest',
|
||||||
? ''
|
|
||||||
: 'AddTrackRequest',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cid')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'cid')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'name')
|
|
||||||
..e<$0.TrackType>(
|
..e<$0.TrackType>(
|
||||||
3,
|
3,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'type',
|
||||||
? ''
|
|
||||||
: 'type',
|
|
||||||
$pb.PbFieldType.OE,
|
$pb.PbFieldType.OE,
|
||||||
defaultOrMaker: $0.TrackType.AUDIO,
|
defaultOrMaker: $0.TrackType.AUDIO,
|
||||||
valueOf: $0.TrackType.valueOf,
|
valueOf: $0.TrackType.valueOf,
|
||||||
enumValues: $0.TrackType.values)
|
enumValues: $0.TrackType.values)
|
||||||
..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width', $pb.PbFieldType.OU3)
|
..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'width',
|
||||||
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.OU3)
|
$pb.PbFieldType.OU3)
|
||||||
|
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height',
|
||||||
|
$pb.PbFieldType.OU3)
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
AddTrackRequest._() : super();
|
AddTrackRequest._() : super();
|
||||||
@@ -580,11 +558,10 @@ class AddTrackRequest extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static AddTrackRequest create() => AddTrackRequest._();
|
static AddTrackRequest create() => AddTrackRequest._();
|
||||||
AddTrackRequest createEmptyInstance() => create();
|
AddTrackRequest createEmptyInstance() => create();
|
||||||
static $pb.PbList<AddTrackRequest> createRepeated() =>
|
static $pb.PbList<AddTrackRequest> createRepeated() => $pb.PbList<AddTrackRequest>();
|
||||||
$pb.PbList<AddTrackRequest>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static AddTrackRequest getDefault() => _defaultInstance ??=
|
static AddTrackRequest getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<AddTrackRequest>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<AddTrackRequest>(create);
|
||||||
static AddTrackRequest? _defaultInstance;
|
static AddTrackRequest? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -650,22 +627,15 @@ class AddTrackRequest extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class TrickleRequest extends $pb.GeneratedMessage {
|
class TrickleRequest extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TrickleRequest',
|
||||||
? ''
|
|
||||||
: 'TrickleRequest',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'candidateInit',
|
||||||
1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'candidateInit',
|
|
||||||
protoName: 'candidateInit')
|
protoName: 'candidateInit')
|
||||||
..e<SignalTarget>(
|
..e<SignalTarget>(
|
||||||
2,
|
2,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'target',
|
||||||
? ''
|
|
||||||
: 'target',
|
|
||||||
$pb.PbFieldType.OE,
|
$pb.PbFieldType.OE,
|
||||||
defaultOrMaker: SignalTarget.PUBLISHER,
|
defaultOrMaker: SignalTarget.PUBLISHER,
|
||||||
valueOf: SignalTarget.valueOf,
|
valueOf: SignalTarget.valueOf,
|
||||||
@@ -706,11 +676,10 @@ class TrickleRequest extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static TrickleRequest create() => TrickleRequest._();
|
static TrickleRequest create() => TrickleRequest._();
|
||||||
TrickleRequest createEmptyInstance() => create();
|
TrickleRequest createEmptyInstance() => create();
|
||||||
static $pb.PbList<TrickleRequest> createRepeated() =>
|
static $pb.PbList<TrickleRequest> createRepeated() => $pb.PbList<TrickleRequest>();
|
||||||
$pb.PbList<TrickleRequest>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static TrickleRequest getDefault() => _defaultInstance ??=
|
static TrickleRequest getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<TrickleRequest>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<TrickleRequest>(create);
|
||||||
static TrickleRequest? _defaultInstance;
|
static TrickleRequest? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -740,24 +709,12 @@ class TrickleRequest extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class MuteTrackRequest extends $pb.GeneratedMessage {
|
class MuteTrackRequest extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MuteTrackRequest',
|
||||||
? ''
|
|
||||||
: 'MuteTrackRequest',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sid')
|
||||||
1,
|
..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'muted')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'sid')
|
|
||||||
..aOB(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'muted')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
MuteTrackRequest._() : super();
|
MuteTrackRequest._() : super();
|
||||||
@@ -794,11 +751,10 @@ class MuteTrackRequest extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static MuteTrackRequest create() => MuteTrackRequest._();
|
static MuteTrackRequest create() => MuteTrackRequest._();
|
||||||
MuteTrackRequest createEmptyInstance() => create();
|
MuteTrackRequest createEmptyInstance() => create();
|
||||||
static $pb.PbList<MuteTrackRequest> createRepeated() =>
|
static $pb.PbList<MuteTrackRequest> createRepeated() => $pb.PbList<MuteTrackRequest>();
|
||||||
$pb.PbList<MuteTrackRequest>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static MuteTrackRequest getDefault() => _defaultInstance ??=
|
static MuteTrackRequest getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<MuteTrackRequest>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MuteTrackRequest>(create);
|
||||||
static MuteTrackRequest? _defaultInstance;
|
static MuteTrackRequest? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -828,24 +784,14 @@ class MuteTrackRequest extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class SetSimulcastLayers extends $pb.GeneratedMessage {
|
class SetSimulcastLayers extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SetSimulcastLayers',
|
||||||
? ''
|
|
||||||
: 'SetSimulcastLayers',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trackSid')
|
||||||
1,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'trackSid')
|
|
||||||
..pc<VideoQuality>(
|
..pc<VideoQuality>(
|
||||||
2,
|
2,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'layers',
|
||||||
? ''
|
|
||||||
: 'layers',
|
|
||||||
$pb.PbFieldType.PE,
|
$pb.PbFieldType.PE,
|
||||||
valueOf: VideoQuality.valueOf,
|
valueOf: VideoQuality.valueOf,
|
||||||
enumValues: VideoQuality.values)
|
enumValues: VideoQuality.values)
|
||||||
@@ -885,11 +831,10 @@ class SetSimulcastLayers extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SetSimulcastLayers create() => SetSimulcastLayers._();
|
static SetSimulcastLayers create() => SetSimulcastLayers._();
|
||||||
SetSimulcastLayers createEmptyInstance() => create();
|
SetSimulcastLayers createEmptyInstance() => create();
|
||||||
static $pb.PbList<SetSimulcastLayers> createRepeated() =>
|
static $pb.PbList<SetSimulcastLayers> createRepeated() => $pb.PbList<SetSimulcastLayers>();
|
||||||
$pb.PbList<SetSimulcastLayers>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SetSimulcastLayers getDefault() => _defaultInstance ??=
|
static SetSimulcastLayers getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<SetSimulcastLayers>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SetSimulcastLayers>(create);
|
||||||
static SetSimulcastLayers? _defaultInstance;
|
static SetSimulcastLayers? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -909,11 +854,10 @@ class SetSimulcastLayers extends $pb.GeneratedMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class JoinResponse extends $pb.GeneratedMessage {
|
class JoinResponse extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'JoinResponse',
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'JoinResponse',
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOM<$0.Room>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'room',
|
..aOM<$0.Room>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'room',
|
||||||
subBuilder: $0.Room.create)
|
subBuilder: $0.Room.create)
|
||||||
@@ -922,13 +866,13 @@ class JoinResponse extends $pb.GeneratedMessage {
|
|||||||
subBuilder: $0.ParticipantInfo.create)
|
subBuilder: $0.ParticipantInfo.create)
|
||||||
..pc<$0.ParticipantInfo>(
|
..pc<$0.ParticipantInfo>(
|
||||||
3,
|
3,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'otherParticipants',
|
||||||
? ''
|
|
||||||
: 'otherParticipants',
|
|
||||||
$pb.PbFieldType.PM,
|
$pb.PbFieldType.PM,
|
||||||
subBuilder: $0.ParticipantInfo.create)
|
subBuilder: $0.ParticipantInfo.create)
|
||||||
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serverVersion')
|
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serverVersion')
|
||||||
..pc<ICEServer>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'iceServers', $pb.PbFieldType.PM, subBuilder: ICEServer.create)
|
..pc<ICEServer>(
|
||||||
|
5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'iceServers', $pb.PbFieldType.PM,
|
||||||
|
subBuilder: ICEServer.create)
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
JoinResponse._() : super();
|
JoinResponse._() : super();
|
||||||
@@ -977,11 +921,10 @@ class JoinResponse extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static JoinResponse create() => JoinResponse._();
|
static JoinResponse create() => JoinResponse._();
|
||||||
JoinResponse createEmptyInstance() => create();
|
JoinResponse createEmptyInstance() => create();
|
||||||
static $pb.PbList<JoinResponse> createRepeated() =>
|
static $pb.PbList<JoinResponse> createRepeated() => $pb.PbList<JoinResponse>();
|
||||||
$pb.PbList<JoinResponse>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static JoinResponse getDefault() => _defaultInstance ??=
|
static JoinResponse getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<JoinResponse>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<JoinResponse>(create);
|
||||||
static JoinResponse? _defaultInstance;
|
static JoinResponse? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1037,20 +980,11 @@ class TrackPublishedResponse extends $pb.GeneratedMessage {
|
|||||||
? ''
|
? ''
|
||||||
: 'TrackPublishedResponse',
|
: 'TrackPublishedResponse',
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cid')
|
||||||
1,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'cid')
|
|
||||||
..aOM<$0.TrackInfo>(
|
..aOM<$0.TrackInfo>(
|
||||||
2,
|
2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'track',
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'track',
|
|
||||||
subBuilder: $0.TrackInfo.create)
|
subBuilder: $0.TrackInfo.create)
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
@@ -1077,13 +1011,11 @@ class TrackPublishedResponse extends $pb.GeneratedMessage {
|
|||||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||||
'Will be removed in next major version')
|
'Will be removed in next major version')
|
||||||
TrackPublishedResponse clone() =>
|
TrackPublishedResponse clone() => TrackPublishedResponse()..mergeFromMessage(this);
|
||||||
TrackPublishedResponse()..mergeFromMessage(this);
|
|
||||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||||
'Will be removed in next major version')
|
'Will be removed in next major version')
|
||||||
TrackPublishedResponse copyWith(
|
TrackPublishedResponse copyWith(void Function(TrackPublishedResponse) updates) =>
|
||||||
void Function(TrackPublishedResponse) updates) =>
|
|
||||||
super.copyWith((message) => updates(message as TrackPublishedResponse))
|
super.copyWith((message) => updates(message as TrackPublishedResponse))
|
||||||
as TrackPublishedResponse; // ignore: deprecated_member_use
|
as TrackPublishedResponse; // ignore: deprecated_member_use
|
||||||
$pb.BuilderInfo get info_ => _i;
|
$pb.BuilderInfo get info_ => _i;
|
||||||
@@ -1093,8 +1025,8 @@ class TrackPublishedResponse extends $pb.GeneratedMessage {
|
|||||||
static $pb.PbList<TrackPublishedResponse> createRepeated() =>
|
static $pb.PbList<TrackPublishedResponse> createRepeated() =>
|
||||||
$pb.PbList<TrackPublishedResponse>();
|
$pb.PbList<TrackPublishedResponse>();
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static TrackPublishedResponse getDefault() => _defaultInstance ??=
|
static TrackPublishedResponse getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<TrackPublishedResponse>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<TrackPublishedResponse>(create);
|
||||||
static TrackPublishedResponse? _defaultInstance;
|
static TrackPublishedResponse? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1126,24 +1058,12 @@ class TrackPublishedResponse extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class SessionDescription extends $pb.GeneratedMessage {
|
class SessionDescription extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SessionDescription',
|
||||||
? ''
|
|
||||||
: 'SessionDescription',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'type')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sdp')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'type')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'sdp')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
SessionDescription._() : super();
|
SessionDescription._() : super();
|
||||||
@@ -1180,11 +1100,10 @@ class SessionDescription extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SessionDescription create() => SessionDescription._();
|
static SessionDescription create() => SessionDescription._();
|
||||||
SessionDescription createEmptyInstance() => create();
|
SessionDescription createEmptyInstance() => create();
|
||||||
static $pb.PbList<SessionDescription> createRepeated() =>
|
static $pb.PbList<SessionDescription> createRepeated() => $pb.PbList<SessionDescription>();
|
||||||
$pb.PbList<SessionDescription>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SessionDescription getDefault() => _defaultInstance ??=
|
static SessionDescription getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<SessionDescription>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SessionDescription>(create);
|
||||||
static SessionDescription? _defaultInstance;
|
static SessionDescription? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1214,19 +1133,13 @@ class SessionDescription extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class ParticipantUpdate extends $pb.GeneratedMessage {
|
class ParticipantUpdate extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ParticipantUpdate',
|
||||||
? ''
|
|
||||||
: 'ParticipantUpdate',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..pc<$0.ParticipantInfo>(
|
..pc<$0.ParticipantInfo>(
|
||||||
1,
|
1,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'participants',
|
||||||
? ''
|
|
||||||
: 'participants',
|
|
||||||
$pb.PbFieldType.PM,
|
$pb.PbFieldType.PM,
|
||||||
subBuilder: $0.ParticipantInfo.create)
|
subBuilder: $0.ParticipantInfo.create)
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
@@ -1261,11 +1174,10 @@ class ParticipantUpdate extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static ParticipantUpdate create() => ParticipantUpdate._();
|
static ParticipantUpdate create() => ParticipantUpdate._();
|
||||||
ParticipantUpdate createEmptyInstance() => create();
|
ParticipantUpdate createEmptyInstance() => create();
|
||||||
static $pb.PbList<ParticipantUpdate> createRepeated() =>
|
static $pb.PbList<ParticipantUpdate> createRepeated() => $pb.PbList<ParticipantUpdate>();
|
||||||
$pb.PbList<ParticipantUpdate>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static ParticipantUpdate getDefault() => _defaultInstance ??=
|
static ParticipantUpdate getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<ParticipantUpdate>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ParticipantUpdate>(create);
|
||||||
static ParticipantUpdate? _defaultInstance;
|
static ParticipantUpdate? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1274,19 +1186,13 @@ class ParticipantUpdate extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class ActiveSpeakerUpdate extends $pb.GeneratedMessage {
|
class ActiveSpeakerUpdate extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ActiveSpeakerUpdate',
|
||||||
? ''
|
|
||||||
: 'ActiveSpeakerUpdate',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..pc<SpeakerInfo>(
|
..pc<SpeakerInfo>(
|
||||||
1,
|
1,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'speakers',
|
||||||
? ''
|
|
||||||
: 'speakers',
|
|
||||||
$pb.PbFieldType.PM,
|
$pb.PbFieldType.PM,
|
||||||
subBuilder: SpeakerInfo.create)
|
subBuilder: SpeakerInfo.create)
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
@@ -1321,11 +1227,10 @@ class ActiveSpeakerUpdate extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static ActiveSpeakerUpdate create() => ActiveSpeakerUpdate._();
|
static ActiveSpeakerUpdate create() => ActiveSpeakerUpdate._();
|
||||||
ActiveSpeakerUpdate createEmptyInstance() => create();
|
ActiveSpeakerUpdate createEmptyInstance() => create();
|
||||||
static $pb.PbList<ActiveSpeakerUpdate> createRepeated() =>
|
static $pb.PbList<ActiveSpeakerUpdate> createRepeated() => $pb.PbList<ActiveSpeakerUpdate>();
|
||||||
$pb.PbList<ActiveSpeakerUpdate>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static ActiveSpeakerUpdate getDefault() => _defaultInstance ??=
|
static ActiveSpeakerUpdate getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<ActiveSpeakerUpdate>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ActiveSpeakerUpdate>(create);
|
||||||
static ActiveSpeakerUpdate? _defaultInstance;
|
static ActiveSpeakerUpdate? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1334,30 +1239,16 @@ class ActiveSpeakerUpdate extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class SpeakerInfo extends $pb.GeneratedMessage {
|
class SpeakerInfo extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SpeakerInfo',
|
||||||
? ''
|
|
||||||
: 'SpeakerInfo',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sid')
|
||||||
1,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'sid')
|
|
||||||
..a<$core.double>(
|
..a<$core.double>(
|
||||||
2,
|
2,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'level',
|
||||||
? ''
|
|
||||||
: 'level',
|
|
||||||
$pb.PbFieldType.OF)
|
$pb.PbFieldType.OF)
|
||||||
..aOB(
|
..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'active')
|
||||||
3,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'active')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
SpeakerInfo._() : super();
|
SpeakerInfo._() : super();
|
||||||
@@ -1400,8 +1291,8 @@ class SpeakerInfo extends $pb.GeneratedMessage {
|
|||||||
SpeakerInfo createEmptyInstance() => create();
|
SpeakerInfo createEmptyInstance() => create();
|
||||||
static $pb.PbList<SpeakerInfo> createRepeated() => $pb.PbList<SpeakerInfo>();
|
static $pb.PbList<SpeakerInfo> createRepeated() => $pb.PbList<SpeakerInfo>();
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static SpeakerInfo getDefault() => _defaultInstance ??=
|
static SpeakerInfo getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<SpeakerInfo>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SpeakerInfo>(create);
|
||||||
static SpeakerInfo? _defaultInstance;
|
static SpeakerInfo? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1443,24 +1334,12 @@ class SpeakerInfo extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class UpdateSubscription extends $pb.GeneratedMessage {
|
class UpdateSubscription extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateSubscription',
|
||||||
? ''
|
|
||||||
: 'UpdateSubscription',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..pPS(
|
..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trackSids')
|
||||||
1,
|
..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'subscribe')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'trackSids')
|
|
||||||
..aOB(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'subscribe')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
UpdateSubscription._() : super();
|
UpdateSubscription._() : super();
|
||||||
@@ -1497,11 +1376,10 @@ class UpdateSubscription extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static UpdateSubscription create() => UpdateSubscription._();
|
static UpdateSubscription create() => UpdateSubscription._();
|
||||||
UpdateSubscription createEmptyInstance() => create();
|
UpdateSubscription createEmptyInstance() => create();
|
||||||
static $pb.PbList<UpdateSubscription> createRepeated() =>
|
static $pb.PbList<UpdateSubscription> createRepeated() => $pb.PbList<UpdateSubscription>();
|
||||||
$pb.PbList<UpdateSubscription>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static UpdateSubscription getDefault() => _defaultInstance ??=
|
static UpdateSubscription getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<UpdateSubscription>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateSubscription>(create);
|
||||||
static UpdateSubscription? _defaultInstance;
|
static UpdateSubscription? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1522,29 +1400,15 @@ class UpdateSubscription extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class UpdateTrackSettings extends $pb.GeneratedMessage {
|
class UpdateTrackSettings extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateTrackSettings',
|
||||||
? ''
|
|
||||||
: 'UpdateTrackSettings',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..pPS(
|
..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trackSids')
|
||||||
1,
|
..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'disabled')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'trackSids')
|
|
||||||
..aOB(
|
|
||||||
3,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'disabled')
|
|
||||||
..e<VideoQuality>(
|
..e<VideoQuality>(
|
||||||
4,
|
4,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'quality',
|
||||||
? ''
|
|
||||||
: 'quality',
|
|
||||||
$pb.PbFieldType.OE,
|
$pb.PbFieldType.OE,
|
||||||
defaultOrMaker: VideoQuality.LOW,
|
defaultOrMaker: VideoQuality.LOW,
|
||||||
valueOf: VideoQuality.valueOf,
|
valueOf: VideoQuality.valueOf,
|
||||||
@@ -1589,11 +1453,10 @@ class UpdateTrackSettings extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static UpdateTrackSettings create() => UpdateTrackSettings._();
|
static UpdateTrackSettings create() => UpdateTrackSettings._();
|
||||||
UpdateTrackSettings createEmptyInstance() => create();
|
UpdateTrackSettings createEmptyInstance() => create();
|
||||||
static $pb.PbList<UpdateTrackSettings> createRepeated() =>
|
static $pb.PbList<UpdateTrackSettings> createRepeated() => $pb.PbList<UpdateTrackSettings>();
|
||||||
$pb.PbList<UpdateTrackSettings>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static UpdateTrackSettings getDefault() => _defaultInstance ??=
|
static UpdateTrackSettings getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<UpdateTrackSettings>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateTrackSettings>(create);
|
||||||
static UpdateTrackSettings? _defaultInstance;
|
static UpdateTrackSettings? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1626,19 +1489,11 @@ class UpdateTrackSettings extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class LeaveRequest extends $pb.GeneratedMessage {
|
class LeaveRequest extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'LeaveRequest',
|
||||||
? ''
|
|
||||||
: 'LeaveRequest',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOB(
|
..aOB(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'canReconnect')
|
||||||
1,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'canReconnect')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
LeaveRequest._() : super();
|
LeaveRequest._() : super();
|
||||||
@@ -1671,11 +1526,10 @@ class LeaveRequest extends $pb.GeneratedMessage {
|
|||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static LeaveRequest create() => LeaveRequest._();
|
static LeaveRequest create() => LeaveRequest._();
|
||||||
LeaveRequest createEmptyInstance() => create();
|
LeaveRequest createEmptyInstance() => create();
|
||||||
static $pb.PbList<LeaveRequest> createRepeated() =>
|
static $pb.PbList<LeaveRequest> createRepeated() => $pb.PbList<LeaveRequest>();
|
||||||
$pb.PbList<LeaveRequest>();
|
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static LeaveRequest getDefault() => _defaultInstance ??=
|
static LeaveRequest getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<LeaveRequest>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<LeaveRequest>(create);
|
||||||
static LeaveRequest? _defaultInstance;
|
static LeaveRequest? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
@@ -1693,29 +1547,13 @@ class LeaveRequest extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class ICEServer extends $pb.GeneratedMessage {
|
class ICEServer extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ICEServer',
|
||||||
? ''
|
|
||||||
: 'ICEServer',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..pPS(
|
..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'urls')
|
||||||
1,
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'username')
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'credential')
|
||||||
? ''
|
|
||||||
: 'urls')
|
|
||||||
..aOS(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'username')
|
|
||||||
..aOS(
|
|
||||||
3,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'credential')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
ICEServer._() : super();
|
ICEServer._() : super();
|
||||||
@@ -1799,21 +1637,20 @@ class DataPacket extends $pb.GeneratedMessage {
|
|||||||
0: DataPacket_Value.notSet
|
0: DataPacket_Value.notSet
|
||||||
};
|
};
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DataPacket',
|
||||||
? ''
|
|
||||||
: 'DataPacket',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..oo(0, [2, 3])
|
..oo(0, [2, 3])
|
||||||
..e<DataPacket_Kind>(
|
..e<DataPacket_Kind>(
|
||||||
1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'kind', $pb.PbFieldType.OE,
|
1,
|
||||||
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'kind',
|
||||||
|
$pb.PbFieldType.OE,
|
||||||
defaultOrMaker: DataPacket_Kind.RELIABLE,
|
defaultOrMaker: DataPacket_Kind.RELIABLE,
|
||||||
valueOf: DataPacket_Kind.valueOf,
|
valueOf: DataPacket_Kind.valueOf,
|
||||||
enumValues: DataPacket_Kind.values)
|
enumValues: DataPacket_Kind.values)
|
||||||
..aOM<UserPacket>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'user',
|
..aOM<UserPacket>(
|
||||||
|
2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'user',
|
||||||
subBuilder: UserPacket.create)
|
subBuilder: UserPacket.create)
|
||||||
..aOM<ActiveSpeakerUpdate>(
|
..aOM<ActiveSpeakerUpdate>(
|
||||||
3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'speaker',
|
3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'speaker',
|
||||||
@@ -1860,8 +1697,8 @@ class DataPacket extends $pb.GeneratedMessage {
|
|||||||
DataPacket createEmptyInstance() => create();
|
DataPacket createEmptyInstance() => create();
|
||||||
static $pb.PbList<DataPacket> createRepeated() => $pb.PbList<DataPacket>();
|
static $pb.PbList<DataPacket> createRepeated() => $pb.PbList<DataPacket>();
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static DataPacket getDefault() => _defaultInstance ??=
|
static DataPacket getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<DataPacket>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DataPacket>(create);
|
||||||
static DataPacket? _defaultInstance;
|
static DataPacket? _defaultInstance;
|
||||||
|
|
||||||
DataPacket_Value whichValue() => _DataPacket_ValueByTag[$_whichOneof(0)]!;
|
DataPacket_Value whichValue() => _DataPacket_ValueByTag[$_whichOneof(0)]!;
|
||||||
@@ -1910,30 +1747,16 @@ class DataPacket extends $pb.GeneratedMessage {
|
|||||||
|
|
||||||
class UserPacket extends $pb.GeneratedMessage {
|
class UserPacket extends $pb.GeneratedMessage {
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UserPacket',
|
||||||
? ''
|
|
||||||
: 'UserPacket',
|
|
||||||
package: const $pb.PackageName(
|
package: const $pb.PackageName(
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'livekit'),
|
||||||
? ''
|
|
||||||
: 'livekit'),
|
|
||||||
createEmptyInstance: create)
|
createEmptyInstance: create)
|
||||||
..aOS(
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'participantSid')
|
||||||
1,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'participantSid')
|
|
||||||
..a<$core.List<$core.int>>(
|
..a<$core.List<$core.int>>(
|
||||||
2,
|
2,
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'payload',
|
||||||
? ''
|
|
||||||
: 'payload',
|
|
||||||
$pb.PbFieldType.OY)
|
$pb.PbFieldType.OY)
|
||||||
..pPS(
|
..pPS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'destinationSids')
|
||||||
3,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
|
||||||
? ''
|
|
||||||
: 'destinationSids')
|
|
||||||
..hasRequiredFields = false;
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
UserPacket._() : super();
|
UserPacket._() : super();
|
||||||
@@ -1976,8 +1799,8 @@ class UserPacket extends $pb.GeneratedMessage {
|
|||||||
UserPacket createEmptyInstance() => create();
|
UserPacket createEmptyInstance() => create();
|
||||||
static $pb.PbList<UserPacket> createRepeated() => $pb.PbList<UserPacket>();
|
static $pb.PbList<UserPacket> createRepeated() => $pb.PbList<UserPacket>();
|
||||||
@$core.pragma('dart2js:noInline')
|
@$core.pragma('dart2js:noInline')
|
||||||
static UserPacket getDefault() => _defaultInstance ??=
|
static UserPacket getDefault() =>
|
||||||
$pb.GeneratedMessage.$_defaultFor<UserPacket>(create);
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UserPacket>(create);
|
||||||
static UserPacket? _defaultInstance;
|
static UserPacket? _defaultInstance;
|
||||||
|
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
|
|||||||
@@ -11,44 +11,28 @@ import 'package:protobuf/protobuf.dart' as $pb;
|
|||||||
|
|
||||||
class SignalTarget extends $pb.ProtobufEnum {
|
class SignalTarget extends $pb.ProtobufEnum {
|
||||||
static const SignalTarget PUBLISHER = SignalTarget._(
|
static const SignalTarget PUBLISHER = SignalTarget._(
|
||||||
0,
|
0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PUBLISHER');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'PUBLISHER');
|
|
||||||
static const SignalTarget SUBSCRIBER = SignalTarget._(
|
static const SignalTarget SUBSCRIBER = SignalTarget._(
|
||||||
1,
|
1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SUBSCRIBER');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'SUBSCRIBER');
|
|
||||||
|
|
||||||
static const $core.List<SignalTarget> values = <SignalTarget>[
|
static const $core.List<SignalTarget> values = <SignalTarget>[
|
||||||
PUBLISHER,
|
PUBLISHER,
|
||||||
SUBSCRIBER,
|
SUBSCRIBER,
|
||||||
];
|
];
|
||||||
|
|
||||||
static final $core.Map<$core.int, SignalTarget> _byValue =
|
static final $core.Map<$core.int, SignalTarget> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||||
$pb.ProtobufEnum.initByValue(values);
|
|
||||||
static SignalTarget? valueOf($core.int value) => _byValue[value];
|
static SignalTarget? valueOf($core.int value) => _byValue[value];
|
||||||
|
|
||||||
const SignalTarget._($core.int v, $core.String n) : super(v, n);
|
const SignalTarget._($core.int v, $core.String n) : super(v, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
class VideoQuality extends $pb.ProtobufEnum {
|
class VideoQuality extends $pb.ProtobufEnum {
|
||||||
static const VideoQuality LOW = VideoQuality._(
|
static const VideoQuality LOW =
|
||||||
0,
|
VideoQuality._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'LOW');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'LOW');
|
|
||||||
static const VideoQuality MEDIUM = VideoQuality._(
|
static const VideoQuality MEDIUM = VideoQuality._(
|
||||||
1,
|
1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'MEDIUM');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
static const VideoQuality HIGH =
|
||||||
? ''
|
VideoQuality._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'HIGH');
|
||||||
: 'MEDIUM');
|
|
||||||
static const VideoQuality HIGH = VideoQuality._(
|
|
||||||
2,
|
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'HIGH');
|
|
||||||
|
|
||||||
static const $core.List<VideoQuality> values = <VideoQuality>[
|
static const $core.List<VideoQuality> values = <VideoQuality>[
|
||||||
LOW,
|
LOW,
|
||||||
@@ -56,8 +40,7 @@ class VideoQuality extends $pb.ProtobufEnum {
|
|||||||
HIGH,
|
HIGH,
|
||||||
];
|
];
|
||||||
|
|
||||||
static final $core.Map<$core.int, VideoQuality> _byValue =
|
static final $core.Map<$core.int, VideoQuality> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||||
$pb.ProtobufEnum.initByValue(values);
|
|
||||||
static VideoQuality? valueOf($core.int value) => _byValue[value];
|
static VideoQuality? valueOf($core.int value) => _byValue[value];
|
||||||
|
|
||||||
const VideoQuality._($core.int v, $core.String n) : super(v, n);
|
const VideoQuality._($core.int v, $core.String n) : super(v, n);
|
||||||
@@ -65,15 +48,9 @@ class VideoQuality extends $pb.ProtobufEnum {
|
|||||||
|
|
||||||
class DataPacket_Kind extends $pb.ProtobufEnum {
|
class DataPacket_Kind extends $pb.ProtobufEnum {
|
||||||
static const DataPacket_Kind RELIABLE = DataPacket_Kind._(
|
static const DataPacket_Kind RELIABLE = DataPacket_Kind._(
|
||||||
0,
|
0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'RELIABLE');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'RELIABLE');
|
|
||||||
static const DataPacket_Kind LOSSY = DataPacket_Kind._(
|
static const DataPacket_Kind LOSSY = DataPacket_Kind._(
|
||||||
1,
|
1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'LOSSY');
|
||||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
|
||||||
? ''
|
|
||||||
: 'LOSSY');
|
|
||||||
|
|
||||||
static const $core.List<DataPacket_Kind> values = <DataPacket_Kind>[
|
static const $core.List<DataPacket_Kind> values = <DataPacket_Kind>[
|
||||||
RELIABLE,
|
RELIABLE,
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ const SignalTarget$json = const {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `SignalTarget`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
/// Descriptor for `SignalTarget`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||||
final $typed_data.Uint8List signalTargetDescriptor = $convert.base64Decode(
|
final $typed_data.Uint8List signalTargetDescriptor =
|
||||||
'CgxTaWduYWxUYXJnZXQSDQoJUFVCTElTSEVSEAASDgoKU1VCU0NSSUJFUhAB');
|
$convert.base64Decode('CgxTaWduYWxUYXJnZXQSDQoJUFVCTElTSEVSEAASDgoKU1VCU0NSSUJFUhAB');
|
||||||
@$core.Deprecated('Use videoQualityDescriptor instead')
|
@$core.Deprecated('Use videoQualityDescriptor instead')
|
||||||
const VideoQuality$json = const {
|
const VideoQuality$json = const {
|
||||||
'1': 'VideoQuality',
|
'1': 'VideoQuality',
|
||||||
@@ -32,8 +32,8 @@ const VideoQuality$json = const {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `VideoQuality`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
/// Descriptor for `VideoQuality`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||||
final $typed_data.Uint8List videoQualityDescriptor = $convert.base64Decode(
|
final $typed_data.Uint8List videoQualityDescriptor =
|
||||||
'CgxWaWRlb1F1YWxpdHkSBwoDTE9XEAASCgoGTUVESVVNEAESCAoESElHSBAC');
|
$convert.base64Decode('CgxWaWRlb1F1YWxpdHkSBwoDTE9XEAASCgoGTUVESVVNEAESCAoESElHSBAC');
|
||||||
@$core.Deprecated('Use signalRequestDescriptor instead')
|
@$core.Deprecated('Use signalRequestDescriptor instead')
|
||||||
const SignalRequest$json = const {
|
const SignalRequest$json = const {
|
||||||
'1': 'SignalRequest',
|
'1': 'SignalRequest',
|
||||||
@@ -219,14 +219,7 @@ const AddTrackRequest$json = const {
|
|||||||
'2': const [
|
'2': const [
|
||||||
const {'1': 'cid', '3': 1, '4': 1, '5': 9, '10': 'cid'},
|
const {'1': 'cid', '3': 1, '4': 1, '5': 9, '10': 'cid'},
|
||||||
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
|
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
|
||||||
const {
|
const {'1': 'type', '3': 3, '4': 1, '5': 14, '6': '.livekit.TrackType', '10': 'type'},
|
||||||
'1': 'type',
|
|
||||||
'3': 3,
|
|
||||||
'4': 1,
|
|
||||||
'5': 14,
|
|
||||||
'6': '.livekit.TrackType',
|
|
||||||
'10': 'type'
|
|
||||||
},
|
|
||||||
const {'1': 'width', '3': 4, '4': 1, '5': 13, '10': 'width'},
|
const {'1': 'width', '3': 4, '4': 1, '5': 13, '10': 'width'},
|
||||||
const {'1': 'height', '3': 5, '4': 1, '5': 13, '10': 'height'},
|
const {'1': 'height', '3': 5, '4': 1, '5': 13, '10': 'height'},
|
||||||
],
|
],
|
||||||
@@ -240,14 +233,7 @@ const TrickleRequest$json = const {
|
|||||||
'1': 'TrickleRequest',
|
'1': 'TrickleRequest',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {'1': 'candidateInit', '3': 1, '4': 1, '5': 9, '10': 'candidateInit'},
|
const {'1': 'candidateInit', '3': 1, '4': 1, '5': 9, '10': 'candidateInit'},
|
||||||
const {
|
const {'1': 'target', '3': 2, '4': 1, '5': 14, '6': '.livekit.SignalTarget', '10': 'target'},
|
||||||
'1': 'target',
|
|
||||||
'3': 2,
|
|
||||||
'4': 1,
|
|
||||||
'5': 14,
|
|
||||||
'6': '.livekit.SignalTarget',
|
|
||||||
'10': 'target'
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -271,14 +257,7 @@ const SetSimulcastLayers$json = const {
|
|||||||
'1': 'SetSimulcastLayers',
|
'1': 'SetSimulcastLayers',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {'1': 'track_sid', '3': 1, '4': 1, '5': 9, '10': 'trackSid'},
|
const {'1': 'track_sid', '3': 1, '4': 1, '5': 9, '10': 'trackSid'},
|
||||||
const {
|
const {'1': 'layers', '3': 2, '4': 3, '5': 14, '6': '.livekit.VideoQuality', '10': 'layers'},
|
||||||
'1': 'layers',
|
|
||||||
'3': 2,
|
|
||||||
'4': 3,
|
|
||||||
'5': 14,
|
|
||||||
'6': '.livekit.VideoQuality',
|
|
||||||
'10': 'layers'
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -289,14 +268,7 @@ final $typed_data.Uint8List setSimulcastLayersDescriptor = $convert.base64Decode
|
|||||||
const JoinResponse$json = const {
|
const JoinResponse$json = const {
|
||||||
'1': 'JoinResponse',
|
'1': 'JoinResponse',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {
|
const {'1': 'room', '3': 1, '4': 1, '5': 11, '6': '.livekit.Room', '10': 'room'},
|
||||||
'1': 'room',
|
|
||||||
'3': 1,
|
|
||||||
'4': 1,
|
|
||||||
'5': 11,
|
|
||||||
'6': '.livekit.Room',
|
|
||||||
'10': 'room'
|
|
||||||
},
|
|
||||||
const {
|
const {
|
||||||
'1': 'participant',
|
'1': 'participant',
|
||||||
'3': 2,
|
'3': 2,
|
||||||
@@ -313,13 +285,7 @@ const JoinResponse$json = const {
|
|||||||
'6': '.livekit.ParticipantInfo',
|
'6': '.livekit.ParticipantInfo',
|
||||||
'10': 'otherParticipants'
|
'10': 'otherParticipants'
|
||||||
},
|
},
|
||||||
const {
|
const {'1': 'server_version', '3': 4, '4': 1, '5': 9, '10': 'serverVersion'},
|
||||||
'1': 'server_version',
|
|
||||||
'3': 4,
|
|
||||||
'4': 1,
|
|
||||||
'5': 9,
|
|
||||||
'10': 'serverVersion'
|
|
||||||
},
|
|
||||||
const {
|
const {
|
||||||
'1': 'ice_servers',
|
'1': 'ice_servers',
|
||||||
'3': 5,
|
'3': 5,
|
||||||
@@ -339,20 +305,12 @@ const TrackPublishedResponse$json = const {
|
|||||||
'1': 'TrackPublishedResponse',
|
'1': 'TrackPublishedResponse',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {'1': 'cid', '3': 1, '4': 1, '5': 9, '10': 'cid'},
|
const {'1': 'cid', '3': 1, '4': 1, '5': 9, '10': 'cid'},
|
||||||
const {
|
const {'1': 'track', '3': 2, '4': 1, '5': 11, '6': '.livekit.TrackInfo', '10': 'track'},
|
||||||
'1': 'track',
|
|
||||||
'3': 2,
|
|
||||||
'4': 1,
|
|
||||||
'5': 11,
|
|
||||||
'6': '.livekit.TrackInfo',
|
|
||||||
'10': 'track'
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `TrackPublishedResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `TrackPublishedResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List trackPublishedResponseDescriptor =
|
final $typed_data.Uint8List trackPublishedResponseDescriptor = $convert.base64Decode(
|
||||||
$convert.base64Decode(
|
|
||||||
'ChZUcmFja1B1Ymxpc2hlZFJlc3BvbnNlEhAKA2NpZBgBIAEoCVIDY2lkEigKBXRyYWNrGAIgASgLMhIubGl2ZWtpdC5UcmFja0luZm9SBXRyYWNr');
|
'ChZUcmFja1B1Ymxpc2hlZFJlc3BvbnNlEhAKA2NpZBgBIAEoCVIDY2lkEigKBXRyYWNrGAIgASgLMhIubGl2ZWtpdC5UcmFja0luZm9SBXRyYWNr');
|
||||||
@$core.Deprecated('Use sessionDescriptionDescriptor instead')
|
@$core.Deprecated('Use sessionDescriptionDescriptor instead')
|
||||||
const SessionDescription$json = const {
|
const SessionDescription$json = const {
|
||||||
@@ -388,14 +346,7 @@ final $typed_data.Uint8List participantUpdateDescriptor = $convert.base64Decode(
|
|||||||
const ActiveSpeakerUpdate$json = const {
|
const ActiveSpeakerUpdate$json = const {
|
||||||
'1': 'ActiveSpeakerUpdate',
|
'1': 'ActiveSpeakerUpdate',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {
|
const {'1': 'speakers', '3': 1, '4': 3, '5': 11, '6': '.livekit.SpeakerInfo', '10': 'speakers'},
|
||||||
'1': 'speakers',
|
|
||||||
'3': 1,
|
|
||||||
'4': 3,
|
|
||||||
'5': 11,
|
|
||||||
'6': '.livekit.SpeakerInfo',
|
|
||||||
'10': 'speakers'
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -433,14 +384,7 @@ const UpdateTrackSettings$json = const {
|
|||||||
'2': const [
|
'2': const [
|
||||||
const {'1': 'track_sids', '3': 1, '4': 3, '5': 9, '10': 'trackSids'},
|
const {'1': 'track_sids', '3': 1, '4': 3, '5': 9, '10': 'trackSids'},
|
||||||
const {'1': 'disabled', '3': 3, '4': 1, '5': 8, '10': 'disabled'},
|
const {'1': 'disabled', '3': 3, '4': 1, '5': 8, '10': 'disabled'},
|
||||||
const {
|
const {'1': 'quality', '3': 4, '4': 1, '5': 14, '6': '.livekit.VideoQuality', '10': 'quality'},
|
||||||
'1': 'quality',
|
|
||||||
'3': 4,
|
|
||||||
'4': 1,
|
|
||||||
'5': 14,
|
|
||||||
'6': '.livekit.VideoQuality',
|
|
||||||
'10': 'quality'
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -456,8 +400,8 @@ const LeaveRequest$json = const {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `LeaveRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `LeaveRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List leaveRequestDescriptor = $convert.base64Decode(
|
final $typed_data.Uint8List leaveRequestDescriptor =
|
||||||
'CgxMZWF2ZVJlcXVlc3QSIwoNY2FuX3JlY29ubmVjdBgBIAEoCFIMY2FuUmVjb25uZWN0');
|
$convert.base64Decode('CgxMZWF2ZVJlcXVlc3QSIwoNY2FuX3JlY29ubmVjdBgBIAEoCFIMY2FuUmVjb25uZWN0');
|
||||||
@$core.Deprecated('Use iCEServerDescriptor instead')
|
@$core.Deprecated('Use iCEServerDescriptor instead')
|
||||||
const ICEServer$json = const {
|
const ICEServer$json = const {
|
||||||
'1': 'ICEServer',
|
'1': 'ICEServer',
|
||||||
@@ -475,23 +419,8 @@ final $typed_data.Uint8List iCEServerDescriptor = $convert.base64Decode(
|
|||||||
const DataPacket$json = const {
|
const DataPacket$json = const {
|
||||||
'1': 'DataPacket',
|
'1': 'DataPacket',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {
|
const {'1': 'kind', '3': 1, '4': 1, '5': 14, '6': '.livekit.DataPacket.Kind', '10': 'kind'},
|
||||||
'1': 'kind',
|
const {'1': 'user', '3': 2, '4': 1, '5': 11, '6': '.livekit.UserPacket', '9': 0, '10': 'user'},
|
||||||
'3': 1,
|
|
||||||
'4': 1,
|
|
||||||
'5': 14,
|
|
||||||
'6': '.livekit.DataPacket.Kind',
|
|
||||||
'10': 'kind'
|
|
||||||
},
|
|
||||||
const {
|
|
||||||
'1': 'user',
|
|
||||||
'3': 2,
|
|
||||||
'4': 1,
|
|
||||||
'5': 11,
|
|
||||||
'6': '.livekit.UserPacket',
|
|
||||||
'9': 0,
|
|
||||||
'10': 'user'
|
|
||||||
},
|
|
||||||
const {
|
const {
|
||||||
'1': 'speaker',
|
'1': 'speaker',
|
||||||
'3': 3,
|
'3': 3,
|
||||||
@@ -524,21 +453,9 @@ final $typed_data.Uint8List dataPacketDescriptor = $convert.base64Decode(
|
|||||||
const UserPacket$json = const {
|
const UserPacket$json = const {
|
||||||
'1': 'UserPacket',
|
'1': 'UserPacket',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {
|
const {'1': 'participant_sid', '3': 1, '4': 1, '5': 9, '10': 'participantSid'},
|
||||||
'1': 'participant_sid',
|
|
||||||
'3': 1,
|
|
||||||
'4': 1,
|
|
||||||
'5': 9,
|
|
||||||
'10': 'participantSid'
|
|
||||||
},
|
|
||||||
const {'1': 'payload', '3': 2, '4': 1, '5': 12, '10': 'payload'},
|
const {'1': 'payload', '3': 2, '4': 1, '5': 12, '10': 'payload'},
|
||||||
const {
|
const {'1': 'destination_sids', '3': 3, '4': 3, '5': 9, '10': 'destinationSids'},
|
||||||
'1': 'destination_sids',
|
|
||||||
'3': 3,
|
|
||||||
'4': 3,
|
|
||||||
'5': 9,
|
|
||||||
'10': 'destinationSids'
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+69
-73
@@ -21,9 +21,9 @@ import 'track/track.dart';
|
|||||||
import 'track/track_publication.dart';
|
import 'track/track_publication.dart';
|
||||||
|
|
||||||
enum RoomState {
|
enum RoomState {
|
||||||
Disconnected,
|
disconnected,
|
||||||
Connected,
|
connected,
|
||||||
Reconnecting,
|
reconnecting,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delegate for [Room] callbacks
|
/// Delegate for [Room] callbacks
|
||||||
@@ -68,21 +68,19 @@ mixin RoomDelegate {
|
|||||||
|
|
||||||
/// When a new track is published to room *after* the current participant has
|
/// When a new track is published to room *after* the current participant has
|
||||||
/// joined. It will not fire for tracks that are already published
|
/// joined. It will not fire for tracks that are already published
|
||||||
void onTrackPublished(
|
void onTrackPublished(RemoteParticipant participant, RemoteTrackPublication publication) {}
|
||||||
RemoteParticipant participant, RemoteTrackPublication publication) {}
|
|
||||||
|
|
||||||
/// A [RemoteParticipant] has unpublished a track
|
/// A [RemoteParticipant] has unpublished a track
|
||||||
void onTrackUnpublished(
|
void onTrackUnpublished(RemoteParticipant participant, RemoteTrackPublication publication) {}
|
||||||
RemoteParticipant participant, RemoteTrackPublication publication) {}
|
|
||||||
|
|
||||||
/// The [LocalParticipant] has subscribed to a new track. This event will **always**
|
/// The [LocalParticipant] has subscribed to a new track. This event will **always**
|
||||||
/// fire as long as new tracks are ready for use.
|
/// fire as long as new tracks are ready for use.
|
||||||
void onTrackSubscribed(RemoteParticipant participant, Track track,
|
void onTrackSubscribed(
|
||||||
RemoteTrackPublication publication) {}
|
RemoteParticipant participant, Track track, RemoteTrackPublication publication) {}
|
||||||
|
|
||||||
/// A subscribed track is no longer available.
|
/// A subscribed track is no longer available.
|
||||||
void onTrackUnsubscribed(RemoteParticipant participant, Track track,
|
void onTrackUnsubscribed(
|
||||||
RemoteTrackPublication publication) {}
|
RemoteParticipant participant, Track track, RemoteTrackPublication publication) {}
|
||||||
|
|
||||||
/// Data received from another [RemoteParticipant].
|
/// Data received from another [RemoteParticipant].
|
||||||
/// Data packets provides the ability to use LiveKit to send/receive arbitrary
|
/// Data packets provides the ability to use LiveKit to send/receive arbitrary
|
||||||
@@ -90,8 +88,7 @@ mixin RoomDelegate {
|
|||||||
void onDataReceived(RemoteParticipant participant, List<int> data) {}
|
void onDataReceived(RemoteParticipant participant, List<int> data) {}
|
||||||
|
|
||||||
/// Encountered failure attempting to subscribe to track.
|
/// Encountered failure attempting to subscribe to track.
|
||||||
void onTrackSubscriptionFailed(
|
void onTrackSubscriptionFailed(RemoteParticipant participant, String sid, String? message) {}
|
||||||
RemoteParticipant participant, String sid, String? message) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Room is the primary construct for LiveKit conferences. It contains a
|
/// Room is the primary construct for LiveKit conferences. It contains a
|
||||||
@@ -104,12 +101,12 @@ mixin RoomDelegate {
|
|||||||
/// * active speakers are different
|
/// * active speakers are different
|
||||||
/// {@category Room}
|
/// {@category Room}
|
||||||
class Room extends ChangeNotifier with ParticipantDelegate {
|
class Room extends ChangeNotifier with ParticipantDelegate {
|
||||||
RoomState _state = RoomState.Disconnected;
|
RoomState _state = RoomState.disconnected;
|
||||||
|
|
||||||
/// connection state of the room
|
/// connection state of the room
|
||||||
RoomState get state => _state;
|
RoomState get state => _state;
|
||||||
|
|
||||||
Map<String, RemoteParticipant> _participants = {};
|
final Map<String, RemoteParticipant> _participants = {};
|
||||||
|
|
||||||
/// map of SID to RemoteParticipant
|
/// map of SID to RemoteParticipant
|
||||||
UnmodifiableMapView<String, RemoteParticipant> get participants =>
|
UnmodifiableMapView<String, RemoteParticipant> get participants =>
|
||||||
@@ -133,14 +130,13 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
/// delegate for room events
|
/// delegate for room events
|
||||||
RoomDelegate? delegate;
|
RoomDelegate? delegate;
|
||||||
|
|
||||||
RTCEngine _engine;
|
final RTCEngine _engine;
|
||||||
|
|
||||||
Completer<Room>? _connectCompleter;
|
Completer<Room>? _connectCompleter;
|
||||||
|
|
||||||
/// internal use
|
/// internal use
|
||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
Room([RTCConfiguration? rtcConfig])
|
Room([RTCConfiguration? rtcConfig]) : _engine = RTCEngine(SignalClient(), rtcConfig) {
|
||||||
: _engine = new RTCEngine(SignalClient(), rtcConfig) {
|
|
||||||
_engine.onTrack = _onTrackAdded;
|
_engine.onTrack = _onTrackAdded;
|
||||||
_engine.onICEConnected = _handleICEConnected;
|
_engine.onICEConnected = _handleICEConnected;
|
||||||
_engine.onDisconnected = _handleDisconnect;
|
_engine.onDisconnected = _handleDisconnect;
|
||||||
@@ -148,26 +144,25 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
_engine.onActiveSpeakerchangedCallback = _handleSpeakerUpdate;
|
_engine.onActiveSpeakerchangedCallback = _handleSpeakerUpdate;
|
||||||
_engine.onDataMessageCallback = _handleDataPacket;
|
_engine.onDataMessageCallback = _handleDataPacket;
|
||||||
_engine.onReconnected = () {
|
_engine.onReconnected = () {
|
||||||
_state = RoomState.Connected;
|
_state = RoomState.connected;
|
||||||
delegate?.onReconnected();
|
delegate?.onReconnected();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
};
|
};
|
||||||
_engine.onReconnecting = () {
|
_engine.onReconnecting = () {
|
||||||
_state = RoomState.Reconnecting;
|
_state = RoomState.reconnecting;
|
||||||
delegate?.onReconnecting();
|
delegate?.onReconnecting();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Room> connect(String url, String token, [JoinOptions? opts]) async {
|
Future<Room> connect(String url, String token, [JoinOptions? opts]) async {
|
||||||
var completer = new Completer<Room>();
|
final completer = Completer<Room>();
|
||||||
_connectCompleter = completer;
|
_connectCompleter = completer;
|
||||||
|
|
||||||
var joinResponse = await _engine.join(url, token, opts);
|
final joinResponse = await _engine.join(url, token, opts);
|
||||||
logger.fine(
|
logger.fine('connected to LiveKit server, version: ${joinResponse.serverVersion}');
|
||||||
'connected to LiveKit server, version: ${joinResponse.serverVersion}');
|
|
||||||
|
|
||||||
localParticipant = new LocalParticipant(
|
localParticipant = LocalParticipant(
|
||||||
engine: _engine,
|
engine: _engine,
|
||||||
info: joinResponse.participant,
|
info: joinResponse.participant,
|
||||||
);
|
);
|
||||||
@@ -176,17 +171,17 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
sid = joinResponse.room.sid;
|
sid = joinResponse.room.sid;
|
||||||
name = joinResponse.room.name;
|
name = joinResponse.room.name;
|
||||||
|
|
||||||
for (var info in joinResponse.otherParticipants) {
|
for (final info in joinResponse.otherParticipants) {
|
||||||
_getOrCreateRemoteParticipant(info.sid, info);
|
_getOrCreateRemoteParticipant(info.sid, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
// room is not ready until ICE is connected. so we would return a completer for now
|
// room is not ready until ICE is connected. so we would return a completer for now
|
||||||
// if it times out, we'll fail the completer
|
// if it times out, we'll fail the completer
|
||||||
Timer(Duration(seconds: 5), () {
|
Timer(const Duration(seconds: 5), () {
|
||||||
if (_state != RoomState.Disconnected) {
|
if (_state != RoomState.disconnected) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_state = RoomState.Disconnected;
|
_state = RoomState.disconnected;
|
||||||
_connectCompleter?.completeError(ConnectError());
|
_connectCompleter?.completeError(ConnectError());
|
||||||
_connectCompleter = null;
|
_connectCompleter = null;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
@@ -196,13 +191,12 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Disconnects from the room, notifying server of disconnection.
|
/// Disconnects from the room, notifying server of disconnection.
|
||||||
disconnect() {
|
void disconnect() {
|
||||||
_engine.client.sendLeave();
|
_engine.client.sendLeave();
|
||||||
_handleDisconnect();
|
_handleDisconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteParticipant _getOrCreateRemoteParticipant(
|
RemoteParticipant _getOrCreateRemoteParticipant(String sid, ParticipantInfo? info) {
|
||||||
String sid, ParticipantInfo? info) {
|
|
||||||
var participant = _participants[sid];
|
var participant = _participants[sid];
|
||||||
if (participant != null) {
|
if (participant != null) {
|
||||||
return participant;
|
return participant;
|
||||||
@@ -219,40 +213,40 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
return participant;
|
return participant;
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleICEConnected() {
|
void _handleICEConnected() {
|
||||||
_connectCompleter?.complete(this);
|
_connectCompleter?.complete(this);
|
||||||
_connectCompleter = null;
|
_connectCompleter = null;
|
||||||
_state = RoomState.Connected;
|
_state = RoomState.connected;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleDisconnect() {
|
void _handleDisconnect() {
|
||||||
if (_state == RoomState.Disconnected) {
|
if (_state == RoomState.disconnected) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var p in _participants.values) {
|
for (final p in _participants.values) {
|
||||||
var tracks = List<TrackPublication>.from(p.tracks.values);
|
final tracks = List<TrackPublication>.from(p.tracks.values);
|
||||||
for (var pub in tracks) {
|
for (final pub in tracks) {
|
||||||
p.unpublishTrack(pub.sid);
|
p.unpublishTrack(pub.sid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (var pub in localParticipant.tracks.values) {
|
for (final pub in localParticipant.tracks.values) {
|
||||||
pub.track?.stop();
|
pub.track?.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
_engine.close();
|
_engine.close();
|
||||||
_participants.clear();
|
_participants.clear();
|
||||||
_activeSpeakers.clear();
|
_activeSpeakers.clear();
|
||||||
_state = RoomState.Disconnected;
|
_state = RoomState.disconnected;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
delegate?.onDisconnected();
|
delegate?.onDisconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleParticipantUpdate(List<ParticipantInfo> updates) {
|
void _handleParticipantUpdate(List<ParticipantInfo> updates) {
|
||||||
// trigger change notifier only if list of participants membership is changed
|
// trigger change notifier only if list of participants membership is changed
|
||||||
var hasChanged = false;
|
var hasChanged = false;
|
||||||
for (var info in updates) {
|
for (final info in updates) {
|
||||||
if (localParticipant.sid == info.sid) {
|
if (localParticipant.sid == info.sid) {
|
||||||
localParticipant.updateFromInfo(info);
|
localParticipant.updateFromInfo(info);
|
||||||
continue;
|
continue;
|
||||||
@@ -264,8 +258,8 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var isNew = !_participants.containsKey(info.sid);
|
final isNew = !_participants.containsKey(info.sid);
|
||||||
var participant = _getOrCreateRemoteParticipant(info.sid, info);
|
final participant = _getOrCreateRemoteParticipant(info.sid, info);
|
||||||
|
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
hasChanged = true;
|
hasChanged = true;
|
||||||
@@ -280,10 +274,10 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleSpeakerUpdate(List<SpeakerInfo> speakers) {
|
void _handleSpeakerUpdate(List<SpeakerInfo> speakers) {
|
||||||
var seenSids = Set<String>();
|
final seenSids = <String>{};
|
||||||
List<Participant> newSpeakers = [];
|
List<Participant> newSpeakers = [];
|
||||||
for (var info in speakers) {
|
for (final info in speakers) {
|
||||||
seenSids.add(info.sid);
|
seenSids.add(info.sid);
|
||||||
|
|
||||||
if (info.sid == localParticipant.sid) {
|
if (info.sid == localParticipant.sid) {
|
||||||
@@ -293,7 +287,7 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var participant = participants[info.sid];
|
final participant = participants[info.sid];
|
||||||
if (participant != null) {
|
if (participant != null) {
|
||||||
participant.audioLevel = info.level;
|
participant.audioLevel = info.level;
|
||||||
participant.isSpeaking = true;
|
participant.isSpeaking = true;
|
||||||
@@ -306,7 +300,7 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
localParticipant.audioLevel = 0;
|
localParticipant.audioLevel = 0;
|
||||||
localParticipant.isSpeaking = false;
|
localParticipant.isSpeaking = false;
|
||||||
}
|
}
|
||||||
for (var participant in _participants.values) {
|
for (final participant in _participants.values) {
|
||||||
if (!seenSids.contains(participant.sid)) {
|
if (!seenSids.contains(participant.sid)) {
|
||||||
participant.audioLevel = 0;
|
participant.audioLevel = 0;
|
||||||
participant.isSpeaking = false;
|
participant.isSpeaking = false;
|
||||||
@@ -318,8 +312,8 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleDataPacket(UserPacket packet, DataPacket_Kind kind) {
|
void _handleDataPacket(UserPacket packet, DataPacket_Kind kind) {
|
||||||
var participant = participants[packet.participantSid];
|
final participant = participants[packet.participantSid];
|
||||||
if (participant == null) {
|
if (participant == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -328,8 +322,7 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
delegate?.onDataReceived(participant, packet.payload);
|
delegate?.onDataReceived(participant, packet.payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onTrackAdded(
|
void _onTrackAdded(MediaStreamTrack track, MediaStream? stream, RTCRtpReceiver? receiver) {
|
||||||
MediaStreamTrack track, MediaStream? stream, RTCRtpReceiver? receiver) {
|
|
||||||
if (stream == null) {
|
if (stream == null) {
|
||||||
// we need the stream to get the track's id
|
// we need the stream to get the track's id
|
||||||
logger.severe('received track without mediastream');
|
logger.severe('received track without mediastream');
|
||||||
@@ -337,23 +330,20 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var parsed = _unpackStreamId(stream.id);
|
var parsed = _unpackStreamId(stream.id);
|
||||||
var trackSid = parsed.item2;
|
var trackSid = parsed.item2 ?? track.id;
|
||||||
if (trackSid == null) {
|
|
||||||
trackSid = track.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
var participant = _getOrCreateRemoteParticipant(parsed.item1, null);
|
final participant = _getOrCreateRemoteParticipant(parsed.item1, null);
|
||||||
participant.addSubscribedMediaTrack(track, stream, trackSid);
|
participant.addSubscribedMediaTrack(track, stream, trackSid);
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleParticipantDisconnect(String sid) {
|
void _handleParticipantDisconnect(String sid) {
|
||||||
var participant = _participants.remove(sid);
|
final participant = _participants.remove(sid);
|
||||||
if (participant == null) {
|
if (participant == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var toRemove = List.from(participant.tracks.values);
|
final toRemove = List<TrackPublication>.from(participant.tracks.values);
|
||||||
for (var track in toRemove) {
|
for (final track in toRemove) {
|
||||||
participant.unpublishTrack(track.sid, true);
|
participant.unpublishTrack(track.sid, true);
|
||||||
}
|
}
|
||||||
delegate?.onParticipantDisconnected(participant);
|
delegate?.onParticipantDisconnected(participant);
|
||||||
@@ -361,43 +351,49 @@ class Room extends ChangeNotifier with ParticipantDelegate {
|
|||||||
|
|
||||||
//----------------- forward participant delegate calls ---------------------//
|
//----------------- forward participant delegate calls ---------------------//
|
||||||
|
|
||||||
|
@override
|
||||||
void onMetadataChanged(Participant participant) {
|
void onMetadataChanged(Participant participant) {
|
||||||
delegate?.onMetadataChanged(participant);
|
delegate?.onMetadataChanged(participant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onTrackMuted(Participant participant, TrackPublication publication) {
|
void onTrackMuted(Participant participant, TrackPublication publication) {
|
||||||
delegate?.onTrackMuted(participant, publication);
|
delegate?.onTrackMuted(participant, publication);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onTrackUnmuted(Participant participant, TrackPublication publication) {
|
void onTrackUnmuted(Participant participant, TrackPublication publication) {
|
||||||
delegate?.onTrackUnmuted(participant, publication);
|
delegate?.onTrackUnmuted(participant, publication);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTrackPublished(
|
@override
|
||||||
RemoteParticipant participant, RemoteTrackPublication publication) {
|
void onTrackPublished(RemoteParticipant participant, RemoteTrackPublication publication) {
|
||||||
delegate?.onTrackPublished(participant, publication);
|
delegate?.onTrackPublished(participant, publication);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTrackUnpublished(
|
@override
|
||||||
RemoteParticipant participant, RemoteTrackPublication publication) {
|
void onTrackUnpublished(RemoteParticipant participant, RemoteTrackPublication publication) {
|
||||||
delegate?.onTrackUnpublished(participant, publication);
|
delegate?.onTrackUnpublished(participant, publication);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTrackSubscribed(RemoteParticipant participant, Track track,
|
@override
|
||||||
RemoteTrackPublication publication) {
|
void onTrackSubscribed(
|
||||||
|
RemoteParticipant participant, Track track, RemoteTrackPublication publication) {
|
||||||
delegate?.onTrackSubscribed(participant, track, publication);
|
delegate?.onTrackSubscribed(participant, track, publication);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTrackUnsubscribed(RemoteParticipant participant, Track track,
|
@override
|
||||||
RemoteTrackPublication publication) {
|
void onTrackUnsubscribed(
|
||||||
|
RemoteParticipant participant, Track track, RemoteTrackPublication publication) {
|
||||||
delegate?.onTrackUnsubscribed(participant, track, publication);
|
delegate?.onTrackUnsubscribed(participant, track, publication);
|
||||||
}
|
}
|
||||||
|
|
||||||
// omitted because data dispatching is handled in _handleDataPacket
|
// omitted because data dispatching is handled in _handleDataPacket
|
||||||
|
@override
|
||||||
void onDataReceived(RemoteParticipant participant, List<int> data) {}
|
void onDataReceived(RemoteParticipant participant, List<int> data) {}
|
||||||
|
|
||||||
void onTrackSubscriptionFailed(
|
@override
|
||||||
RemoteParticipant participant, String sid, String? message) {
|
void onTrackSubscriptionFailed(RemoteParticipant participant, String sid, String? message) {
|
||||||
delegate?.onTrackSubscriptionFailed(participant, sid, message);
|
delegate?.onTrackSubscriptionFailed(participant, sid, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+64
-62
@@ -13,26 +13,23 @@ import 'transport.dart';
|
|||||||
|
|
||||||
const lossyDataChannel = '_lossy';
|
const lossyDataChannel = '_lossy';
|
||||||
const reliableDataChannel = '_reliable';
|
const reliableDataChannel = '_reliable';
|
||||||
final connectionTimeout = new Duration(seconds: 5);
|
const connectionTimeout = Duration(seconds: 5);
|
||||||
final maxReconnectAttempts = 5;
|
const maxReconnectAttempts = 5;
|
||||||
final iceRestartTimeout = new Duration(seconds: 10);
|
const iceRestartTimeout = Duration(seconds: 10);
|
||||||
|
|
||||||
typedef GenericCallback = void Function();
|
typedef GenericCallback = void Function();
|
||||||
typedef TrackCallback = void Function(
|
typedef TrackCallback = void Function(
|
||||||
MediaStreamTrack track, MediaStream? stream, RTCRtpReceiver? receiver);
|
MediaStreamTrack track, MediaStream? stream, RTCRtpReceiver? receiver);
|
||||||
typedef ParticipantUpdateCallback = void Function(
|
typedef ParticipantUpdateCallback = void Function(List<ParticipantInfo> participants);
|
||||||
List<ParticipantInfo> participants);
|
typedef ActiveSpeakerChangedCallback = void Function(List<SpeakerInfo> speakers);
|
||||||
typedef ActiveSpeakerChangedCallback = void Function(
|
typedef DataPacketCallback = void Function(UserPacket packet, DataPacket_Kind kind);
|
||||||
List<SpeakerInfo> speakers);
|
|
||||||
typedef DataPacketCallback = void Function(
|
|
||||||
UserPacket packet, DataPacket_Kind kind);
|
|
||||||
|
|
||||||
class RTCEngine with SignalClientDelegate {
|
class RTCEngine with SignalClientDelegate {
|
||||||
PCTransport? publisher;
|
PCTransport? publisher;
|
||||||
PCTransport? subscriber;
|
PCTransport? subscriber;
|
||||||
SignalClient client;
|
SignalClient client;
|
||||||
// config for RTCPeerConnection
|
// config for RTCPeerConnection
|
||||||
RTCConfiguration rtcConfig = new RTCConfiguration();
|
RTCConfiguration rtcConfig = RTCConfiguration();
|
||||||
// data channels for packets
|
// data channels for packets
|
||||||
RTCDataChannel? reliableDC;
|
RTCDataChannel? reliableDC;
|
||||||
RTCDataChannel? lossyDC;
|
RTCDataChannel? lossyDC;
|
||||||
@@ -62,14 +59,14 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
this.rtcConfig = rtcConfig;
|
this.rtcConfig = rtcConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.client.delegate = this;
|
client.delegate = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<JoinResponse> join(String url, String token, JoinOptions? opts) async {
|
Future<JoinResponse> join(String url, String token, JoinOptions? opts) async {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.token = token;
|
this.token = token;
|
||||||
|
|
||||||
var completer = new Completer<JoinResponse>();
|
final completer = Completer<JoinResponse>();
|
||||||
joinCompleter = completer;
|
joinCompleter = completer;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -79,22 +76,22 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if it's not complete after 5 seconds, fail
|
// if it's not complete after 5 seconds, fail
|
||||||
new Timer(connectionTimeout, () {
|
Timer(connectionTimeout, () {
|
||||||
joinCompleter?.completeError(new ConnectError());
|
joinCompleter?.completeError(ConnectError());
|
||||||
joinCompleter = null;
|
joinCompleter = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
return completer.future;
|
return completer.future;
|
||||||
}
|
}
|
||||||
|
|
||||||
close() async {
|
void close() async {
|
||||||
isClosed = true;
|
isClosed = true;
|
||||||
|
|
||||||
if (publisher != null) {
|
if (publisher != null) {
|
||||||
var senders = await publisher?.pc.getSenders();
|
final senders = await publisher?.pc.getSenders();
|
||||||
senders?.forEach((element) async {
|
for (final element in (senders ?? <RTCRtpSender>[])) {
|
||||||
await publisher?.pc.removeTrack(element);
|
await publisher?.pc.removeTrack(element);
|
||||||
});
|
}
|
||||||
|
|
||||||
publisher?.pc.close();
|
publisher?.pc.close();
|
||||||
publisher = null;
|
publisher = null;
|
||||||
@@ -112,11 +109,10 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
required TrackType kind,
|
required TrackType kind,
|
||||||
TrackDimension? dimension}) async {
|
TrackDimension? dimension}) async {
|
||||||
if (pendingTrackResolvers[cid] != null) {
|
if (pendingTrackResolvers[cid] != null) {
|
||||||
throw new TrackPublishError(
|
throw TrackPublishError('a track with the same CID has already been published');
|
||||||
'a track with the same CID has already been published');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var completer = new Completer<TrackInfo>();
|
final completer = Completer<TrackInfo>();
|
||||||
pendingTrackResolvers[cid] = completer;
|
pendingTrackResolvers[cid] = completer;
|
||||||
|
|
||||||
client.sendAddTrack(cid: cid, name: name, type: kind, dimension: dimension);
|
client.sendAddTrack(cid: cid, name: name, type: kind, dimension: dimension);
|
||||||
@@ -124,29 +120,28 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
return completer.future;
|
return completer.future;
|
||||||
}
|
}
|
||||||
|
|
||||||
negotiate({bool? iceRestart}) async {
|
Future<void> negotiate({bool? iceRestart}) async {
|
||||||
var pub = this.publisher;
|
final pub = publisher;
|
||||||
if (pub == null) {
|
if (pub == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var remoteDesc = await pub.getRemoteDescription();
|
final remoteDesc = await pub.getRemoteDescription();
|
||||||
|
|
||||||
// handle cases that we couldn't create a new offer due to a pending answer
|
// handle cases that we couldn't create a new offer due to a pending answer
|
||||||
// that's lost in transit
|
// that's lost in transit
|
||||||
if (remoteDesc != null &&
|
if (remoteDesc != null &&
|
||||||
pub.pc.signalingState ==
|
pub.pc.signalingState == RTCSignalingState.RTCSignalingStateHaveLocalOffer) {
|
||||||
RTCSignalingState.RTCSignalingStateHaveLocalOffer) {
|
|
||||||
await pub.pc.setRemoteDescription(remoteDesc);
|
await pub.pc.setRemoteDescription(remoteDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
var constraints = <String, dynamic>{};
|
final constraints = <String, dynamic>{};
|
||||||
if (iceRestart != null && iceRestart) {
|
if (iceRestart != null && iceRestart) {
|
||||||
constraints['mandatory'] = {
|
constraints['mandatory'] = {
|
||||||
'IceRestart': true,
|
'IceRestart': true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
var offer = await pub.pc.createOffer(constraints);
|
final offer = await pub.pc.createOffer(constraints);
|
||||||
await pub.pc.setLocalDescription(offer);
|
await pub.pc.setLocalDescription(offer);
|
||||||
client.sendOffer(offer);
|
client.sendOffer(offer);
|
||||||
}
|
}
|
||||||
@@ -155,10 +150,10 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
if (isClosed) {
|
if (isClosed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var url = this.url;
|
final url = this.url;
|
||||||
var token = this.token;
|
final token = this.token;
|
||||||
if (url == null || token == null) {
|
if (url == null || token == null) {
|
||||||
throw ConnectError("could not reconnect without url and token");
|
throw ConnectError('could not reconnect without url and token');
|
||||||
}
|
}
|
||||||
if (reconnectAttempts == 0) {
|
if (reconnectAttempts == 0) {
|
||||||
onReconnecting?.call();
|
onReconnecting?.call();
|
||||||
@@ -169,8 +164,8 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
isReconnecting = true;
|
isReconnecting = true;
|
||||||
await client.reconnect(url, token);
|
await client.reconnect(url, token);
|
||||||
|
|
||||||
var pub = this.publisher;
|
final pub = publisher;
|
||||||
var sub = this.subscriber;
|
final sub = subscriber;
|
||||||
if (pub == null || sub == null) {
|
if (pub == null || sub == null) {
|
||||||
throw UnexpectedConnectionState('publisher or subscribers is null');
|
throw UnexpectedConnectionState('publisher or subscribers is null');
|
||||||
}
|
}
|
||||||
@@ -185,28 +180,28 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// wait for connectivity to change
|
// wait for connectivity to change
|
||||||
var startTime = DateTime.now();
|
final startTime = DateTime.now();
|
||||||
while (DateTime.now().difference(startTime) < iceRestartTimeout) {
|
while (DateTime.now().difference(startTime) < iceRestartTimeout) {
|
||||||
if (iceConnected) {
|
if (iceConnected) {
|
||||||
isReconnecting = false;
|
isReconnecting = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await Future.delayed(Duration(milliseconds: 100));
|
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
isReconnecting = false;
|
isReconnecting = false;
|
||||||
return Future.error(ConnectError('could not reconnect ICE'));
|
return Future.error(ConnectError('could not reconnect ICE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
_configurePeerConnections() async {
|
Future<void> _configurePeerConnections() async {
|
||||||
if (publisher != null) {
|
if (publisher != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var pubPC = await createPeerConnection(rtcConfig.toMap());
|
final pubPC = await createPeerConnection(rtcConfig.toMap());
|
||||||
publisher = new PCTransport(pubPC);
|
publisher = PCTransport(pubPC);
|
||||||
var subPC = await createPeerConnection(rtcConfig.toMap());
|
final subPC = await createPeerConnection(rtcConfig.toMap());
|
||||||
subscriber = new PCTransport(subPC);
|
subscriber = PCTransport(subPC);
|
||||||
|
|
||||||
pubPC.onIceCandidate = (RTCIceCandidate candidate) {
|
pubPC.onIceCandidate = (RTCIceCandidate candidate) {
|
||||||
client.sendIceCandidate(candidate, SignalTarget.PUBLISHER);
|
client.sendIceCandidate(candidate, SignalTarget.PUBLISHER);
|
||||||
@@ -217,8 +212,7 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
|
|
||||||
pubPC.onRenegotiationNeeded = () {
|
pubPC.onRenegotiationNeeded = () {
|
||||||
if (pubPC.iceConnectionState == null ||
|
if (pubPC.iceConnectionState == null ||
|
||||||
pubPC.iceConnectionState ==
|
pubPC.iceConnectionState == RTCIceConnectionState.RTCIceConnectionStateNew) {
|
||||||
RTCIceConnectionState.RTCIceConnectionStateNew) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
negotiate();
|
negotiate();
|
||||||
@@ -256,30 +250,29 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// create data channels
|
// create data channels
|
||||||
var lossyInit = new RTCDataChannelInit()
|
final lossyInit = RTCDataChannelInit()
|
||||||
..maxRetransmits = 1
|
..maxRetransmits = 1
|
||||||
..ordered = true
|
..ordered = true
|
||||||
..binaryType = 'binary';
|
..binaryType = 'binary';
|
||||||
lossyDC = await pubPC.createDataChannel(lossyDataChannel, lossyInit);
|
lossyDC = await pubPC.createDataChannel(lossyDataChannel, lossyInit);
|
||||||
|
|
||||||
var reliableInit = new RTCDataChannelInit()
|
final reliableInit = RTCDataChannelInit()
|
||||||
..ordered = true
|
..ordered = true
|
||||||
..maxRetransmits = 50
|
..maxRetransmits = 50
|
||||||
..binaryType = 'binary';
|
..binaryType = 'binary';
|
||||||
reliableDC =
|
reliableDC = await pubPC.createDataChannel(reliableDataChannel, reliableInit);
|
||||||
await pubPC.createDataChannel(reliableDataChannel, reliableInit);
|
|
||||||
|
|
||||||
lossyDC?.onMessage = _handleDataMessage;
|
lossyDC?.onMessage = _handleDataMessage;
|
||||||
reliableDC?.onMessage = _handleDataMessage;
|
reliableDC?.onMessage = _handleDataMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleDataMessage(RTCDataChannelMessage message) {
|
void _handleDataMessage(RTCDataChannelMessage message) {
|
||||||
// always expect binary
|
// always expect binary
|
||||||
if (!message.isBinary) {
|
if (!message.isBinary) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dp = DataPacket.fromBuffer(message.binary);
|
final dp = DataPacket.fromBuffer(message.binary);
|
||||||
switch (dp.whichValue()) {
|
switch (dp.whichValue()) {
|
||||||
case DataPacket_Value.speaker:
|
case DataPacket_Value.speaker:
|
||||||
onActiveSpeakerchangedCallback?.call(dp.speaker.speakers);
|
onActiveSpeakerchangedCallback?.call(dp.speaker.speakers);
|
||||||
@@ -292,23 +285,23 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleDisconnect(String reason) {
|
void _handleDisconnect(String reason) {
|
||||||
if (isClosed) {
|
if (isClosed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.fine('disconnected $reason');
|
logger.fine('disconnected $reason');
|
||||||
if (this.reconnectAttempts >= maxReconnectAttempts) {
|
if (reconnectAttempts >= maxReconnectAttempts) {
|
||||||
logger.info('could not connect after $reconnectAttempts, giving up');
|
logger.info('could not connect after $reconnectAttempts, giving up');
|
||||||
this.close();
|
close();
|
||||||
onDisconnected?.call();
|
onDisconnected?.call();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var delay = (reconnectAttempts * reconnectAttempts) * 300;
|
final delay = (reconnectAttempts * reconnectAttempts) * 300;
|
||||||
Future.delayed(Duration(milliseconds: delay), () {
|
Future.delayed(Duration(milliseconds: delay), () {
|
||||||
reconnect().then((_) {
|
reconnect().then((_) {
|
||||||
reconnectAttempts = 0;
|
reconnectAttempts = 0;
|
||||||
}).catchError((e) {
|
}).catchError((dynamic e) {
|
||||||
_handleDisconnect(reason);
|
_handleDisconnect(reason);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -316,14 +309,15 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
|
|
||||||
//------------------ SignalClient Delegate methods -------------------------//
|
//------------------ SignalClient Delegate methods -------------------------//
|
||||||
|
|
||||||
|
@override
|
||||||
void onConnected(JoinResponse response) async {
|
void onConnected(JoinResponse response) async {
|
||||||
// create peer connections
|
// create peer connections
|
||||||
this.isClosed = false;
|
isClosed = false;
|
||||||
|
|
||||||
if (rtcConfig.iceServers == null && response.iceServers.length > 0) {
|
if (rtcConfig.iceServers == null && response.iceServers.isNotEmpty) {
|
||||||
List<RTCIceServer> iceServers = [];
|
List<RTCIceServer> iceServers = [];
|
||||||
response.iceServers.forEach((item) {
|
for (final item in response.iceServers) {
|
||||||
var iceServer = new RTCIceServer(urls: item.urls);
|
final iceServer = RTCIceServer(urls: item.urls);
|
||||||
if (item.username.isNotEmpty) {
|
if (item.username.isNotEmpty) {
|
||||||
iceServer.username = item.username;
|
iceServer.username = item.username;
|
||||||
}
|
}
|
||||||
@@ -331,7 +325,7 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
iceServer.credential = item.credential;
|
iceServer.credential = item.credential;
|
||||||
}
|
}
|
||||||
iceServers.add(iceServer);
|
iceServers.add(iceServer);
|
||||||
});
|
}
|
||||||
rtcConfig.iceServers = iceServers;
|
rtcConfig.iceServers = iceServers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,22 +337,25 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
joinCompleter = null;
|
joinCompleter = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onClose([String? reason]) {
|
void onClose([String? reason]) {
|
||||||
_handleDisconnect("signal");
|
_handleDisconnect('signal');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onOffer(RTCSessionDescription sd) async {
|
void onOffer(RTCSessionDescription sd) async {
|
||||||
var sub = subscriber;
|
final sub = subscriber;
|
||||||
if (sub == null) {
|
if (sub == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await sub.setRemoteDescription(sd);
|
await sub.setRemoteDescription(sd);
|
||||||
|
|
||||||
var answer = await sub.pc.createAnswer();
|
final answer = await sub.pc.createAnswer();
|
||||||
await sub.pc.setLocalDescription(answer);
|
await sub.pc.setLocalDescription(answer);
|
||||||
client.sendAnswer(answer);
|
client.sendAnswer(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onAnswer(RTCSessionDescription sd) {
|
void onAnswer(RTCSessionDescription sd) {
|
||||||
if (publisher == null) {
|
if (publisher == null) {
|
||||||
return;
|
return;
|
||||||
@@ -367,6 +364,7 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
publisher?.setRemoteDescription(sd);
|
publisher?.setRemoteDescription(sd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onTrickle(RTCIceCandidate candidate, SignalTarget target) {
|
void onTrickle(RTCIceCandidate candidate, SignalTarget target) {
|
||||||
if (target == SignalTarget.SUBSCRIBER) {
|
if (target == SignalTarget.SUBSCRIBER) {
|
||||||
subscriber?.addIceCandidate(candidate);
|
subscriber?.addIceCandidate(candidate);
|
||||||
@@ -375,19 +373,23 @@ class RTCEngine with SignalClientDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onParticipantUpdate(List<ParticipantInfo> updates) {
|
void onParticipantUpdate(List<ParticipantInfo> updates) {
|
||||||
onParticipantUpdateCallback?.call(updates);
|
onParticipantUpdateCallback?.call(updates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onLocalTrackPublished(TrackPublishedResponse response) {
|
void onLocalTrackPublished(TrackPublishedResponse response) {
|
||||||
var completer = pendingTrackResolvers.remove(response.cid);
|
final completer = pendingTrackResolvers.remove(response.cid);
|
||||||
completer?.complete(Future.value(response.track));
|
completer?.complete(Future.value(response.track));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onActiveSpeakersChanged(List<SpeakerInfo> speakers) {
|
void onActiveSpeakersChanged(List<SpeakerInfo> speakers) {
|
||||||
onActiveSpeakerchangedCallback?.call(speakers);
|
onActiveSpeakerchangedCallback?.call(speakers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
void onLeave(LeaveRequest req) {
|
void onLeave(LeaveRequest req) {
|
||||||
close();
|
close();
|
||||||
onDisconnected?.call();
|
onDisconnected?.call();
|
||||||
|
|||||||
+55
-54
@@ -46,30 +46,29 @@ class SignalClient {
|
|||||||
|
|
||||||
SignalClient();
|
SignalClient();
|
||||||
|
|
||||||
bool get connected => this._connected;
|
bool get connected => _connected;
|
||||||
|
|
||||||
Future<void> join(String url, String token, JoinOptions? options) async {
|
Future<void> join(String url, String token, JoinOptions? options) async {
|
||||||
var rtcUrl = '$url/rtc';
|
final rtcUrl = '$url/rtc';
|
||||||
var params = _joinParams(token);
|
var params = _joinParams(token);
|
||||||
if (options != null && options.autoSubscribe != null) {
|
if (options != null && options.autoSubscribe != null) {
|
||||||
params += '&auto_subscribe=${options.autoSubscribe! ? '1' : '0'}';
|
params += '&auto_subscribe=${options.autoSubscribe! ? '1' : '0'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var ws = await platform.connectToWebSocket(Uri.parse(rtcUrl + params));
|
final ws = await platform.connectToWebSocket(Uri.parse(rtcUrl + params));
|
||||||
ws.stream
|
ws.stream.listen(_handleMessage, onError: _handleError, onDone: _handleDone);
|
||||||
.listen(_handleMessage, onError: _handleError, onDone: _handleDone);
|
|
||||||
_ws = ws;
|
_ws = ws;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
var completer = Completer();
|
final completer = Completer<void>();
|
||||||
var validateUri = Uri.parse('http${rtcUrl.substring(2)}/validate$params');
|
final validateUri = Uri.parse('http${rtcUrl.substring(2)}/validate$params');
|
||||||
http.get(validateUri).then((response) {
|
http.get(validateUri).then((response) {
|
||||||
if (response.statusCode != 200) {
|
if (response.statusCode != 200) {
|
||||||
completer.completeError(ConnectError(response.body));
|
completer.completeError(ConnectError(response.body));
|
||||||
} else {
|
} else {
|
||||||
completer.completeError(ConnectError());
|
completer.completeError(ConnectError());
|
||||||
}
|
}
|
||||||
}).catchError((e) {
|
}).catchError((dynamic e) {
|
||||||
completer.completeError(ConnectError());
|
completer.completeError(ConnectError());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -85,53 +84,53 @@ class SignalClient {
|
|||||||
url += '/rtc';
|
url += '/rtc';
|
||||||
var params = _joinParams(token);
|
var params = _joinParams(token);
|
||||||
params += '&reconnect=1';
|
params += '&reconnect=1';
|
||||||
var uri = Uri.parse(url + params);
|
final uri = Uri.parse(url + params);
|
||||||
|
|
||||||
var ws = await platform.connectToWebSocket(uri);
|
final ws = await platform.connectToWebSocket(uri);
|
||||||
_ws = ws;
|
_ws = ws;
|
||||||
_connected = true;
|
_connected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
void close() {
|
||||||
this._connected = false;
|
_connected = false;
|
||||||
this._ws?.sink.close();
|
_ws?.sink.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
sendOffer(RTCSessionDescription offer) {
|
void sendOffer(RTCSessionDescription offer) {
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
offer: fromRTCSessionDescription(offer),
|
offer: fromRTCSessionDescription(offer),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendAnswer(RTCSessionDescription answer) {
|
void sendAnswer(RTCSessionDescription answer) {
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
answer: fromRTCSessionDescription(answer),
|
answer: fromRTCSessionDescription(answer),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendIceCandidate(RTCIceCandidate candidate, SignalTarget target) {
|
void sendIceCandidate(RTCIceCandidate candidate, SignalTarget target) {
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
trickle: new TrickleRequest(
|
trickle: TrickleRequest(
|
||||||
candidateInit: fromRTCIceCandidate(candidate),
|
candidateInit: fromRTCIceCandidate(candidate),
|
||||||
target: target,
|
target: target,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendMuteTrack(String trackSid, bool muted) {
|
void sendMuteTrack(String trackSid, bool muted) {
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
mute: new MuteTrackRequest(
|
mute: MuteTrackRequest(
|
||||||
sid: trackSid,
|
sid: trackSid,
|
||||||
muted: muted,
|
muted: muted,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendAddTrack(
|
void sendAddTrack(
|
||||||
{required String cid,
|
{required String cid,
|
||||||
required String name,
|
required String name,
|
||||||
required TrackType type,
|
required TrackType type,
|
||||||
TrackDimension? dimension}) {
|
TrackDimension? dimension}) {
|
||||||
var req = new AddTrackRequest(
|
final req = AddTrackRequest(
|
||||||
cid: cid,
|
cid: cid,
|
||||||
name: name,
|
name: name,
|
||||||
type: type,
|
type: type,
|
||||||
@@ -140,52 +139,52 @@ class SignalClient {
|
|||||||
req.width = dimension.width;
|
req.width = dimension.width;
|
||||||
req.height = dimension.height;
|
req.height = dimension.height;
|
||||||
}
|
}
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
addTrack: req,
|
addTrack: req,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendUpdateTrackSettings(UpdateTrackSettings settings) {
|
void sendUpdateTrackSettings(UpdateTrackSettings settings) {
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
trackSetting: settings,
|
trackSetting: settings,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendUpdateSubscription(UpdateSubscription subscription) {
|
void sendUpdateSubscription(UpdateSubscription subscription) {
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
subscription: subscription,
|
subscription: subscription,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendSetSimulcastLayers(String trackSid, List<VideoQuality> layers) {
|
void sendSetSimulcastLayers(String trackSid, List<VideoQuality> layers) {
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
simulcast: new SetSimulcastLayers(
|
simulcast: SetSimulcastLayers(
|
||||||
trackSid: trackSid,
|
trackSid: trackSid,
|
||||||
layers: layers,
|
layers: layers,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendLeave() {
|
void sendLeave() {
|
||||||
this._sendRequest(new SignalRequest(
|
_sendRequest(SignalRequest(
|
||||||
leave: new LeaveRequest(),
|
leave: LeaveRequest(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendRequest(SignalRequest req) {
|
void _sendRequest(SignalRequest req) {
|
||||||
if (this._ws == null) {
|
if (_ws == null) {
|
||||||
log('could not send message, not connected');
|
log('could not send message, not connected');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var buf = req.writeToBuffer();
|
final buf = req.writeToBuffer();
|
||||||
this._ws?.sink.add(buf);
|
_ws?.sink.add(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleMessage(dynamic message) {
|
void _handleMessage(dynamic message) {
|
||||||
if (!(message is List<int>)) {
|
if (message is! List<int>) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var msg = SignalResponse.fromBuffer(message);
|
final msg = SignalResponse.fromBuffer(message);
|
||||||
switch (msg.whichMessage()) {
|
switch (msg.whichMessage()) {
|
||||||
case SignalResponse_Message.join:
|
case SignalResponse_Message.join:
|
||||||
if (!_connected) {
|
if (!_connected) {
|
||||||
@@ -200,8 +199,7 @@ class SignalClient {
|
|||||||
delegate?.onOffer(toRTCSessionDescription(msg.offer));
|
delegate?.onOffer(toRTCSessionDescription(msg.offer));
|
||||||
break;
|
break;
|
||||||
case SignalResponse_Message.trickle:
|
case SignalResponse_Message.trickle:
|
||||||
delegate?.onTrickle(
|
delegate?.onTrickle(toRTCIceCandidate(msg.trickle.candidateInit), msg.trickle.target);
|
||||||
toRTCIceCandidate(msg.trickle.candidateInit), msg.trickle.target);
|
|
||||||
break;
|
break;
|
||||||
case SignalResponse_Message.update:
|
case SignalResponse_Message.update:
|
||||||
delegate?.onParticipantUpdate(msg.update.participants);
|
delegate?.onParticipantUpdate(msg.update.participants);
|
||||||
@@ -216,15 +214,15 @@ class SignalClient {
|
|||||||
delegate?.onLeave(msg.leave);
|
delegate?.onLeave(msg.leave);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log('unsupported message: ' + jsonEncode(msg));
|
log('unsupported message: ' + json.encode(msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleError(Object error) {
|
void _handleError(Object error) {
|
||||||
logger.warning('received websocket error $error');
|
logger.warning('received websocket error $error');
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleDone() {
|
void _handleDone() {
|
||||||
if (!_connected) {
|
if (!_connected) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -239,19 +237,22 @@ String _joinParams(String token) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RTCSessionDescription toRTCSessionDescription(SessionDescription sd) {
|
RTCSessionDescription toRTCSessionDescription(SessionDescription sd) {
|
||||||
return new RTCSessionDescription(sd.sdp, sd.type);
|
return RTCSessionDescription(sd.sdp, sd.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionDescription fromRTCSessionDescription(RTCSessionDescription rsd) {
|
SessionDescription fromRTCSessionDescription(RTCSessionDescription rsd) {
|
||||||
return new SessionDescription(type: rsd.type, sdp: rsd.sdp);
|
return SessionDescription(type: rsd.type, sdp: rsd.sdp);
|
||||||
}
|
}
|
||||||
|
|
||||||
RTCIceCandidate toRTCIceCandidate(String candidateInit) {
|
RTCIceCandidate toRTCIceCandidate(String candidateInit) {
|
||||||
var candInit = jsonDecode(candidateInit);
|
final candInit = json.decode(candidateInit) as Map<String, dynamic>;
|
||||||
return new RTCIceCandidate(
|
return RTCIceCandidate(
|
||||||
candInit['candidate'], candInit['sdpMid'], candInit['sdpMLineIndex']);
|
candInit['candidate'] as String?,
|
||||||
|
candInit['sdpMid'] as String?,
|
||||||
|
candInit['sdpMLineIndex'] as int?,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String fromRTCIceCandidate(RTCIceCandidate candidate) {
|
String fromRTCIceCandidate(RTCIceCandidate candidate) {
|
||||||
return jsonEncode(candidate.toMap());
|
return json.encode(candidate.toMap());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ const audioContainerId = 'livekit_audio_container';
|
|||||||
const audioPrefix = 'livekit_audio_';
|
const audioPrefix = 'livekit_audio_';
|
||||||
|
|
||||||
void startAudio(String id, MediaStreamTrack track) {
|
void startAudio(String id, MediaStreamTrack track) {
|
||||||
if (!(track is MediaStreamTrackWeb)) {
|
if (track is! MediaStreamTrackWeb) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var elementId = audioPrefix + id;
|
final elementId = audioPrefix + id;
|
||||||
var audioElement = html.document.getElementById(elementId);
|
var audioElement = html.document.getElementById(elementId);
|
||||||
if (audioElement == null) {
|
if (audioElement == null) {
|
||||||
audioElement = html.AudioElement()
|
audioElement = html.AudioElement()
|
||||||
@@ -21,16 +21,16 @@ void startAudio(String id, MediaStreamTrack track) {
|
|||||||
findOrCreateAudioContainer().append(audioElement);
|
findOrCreateAudioContainer().append(audioElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(audioElement is html.AudioElement)) {
|
if (audioElement is! html.AudioElement) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var audioStream = html.MediaStream();
|
final audioStream = html.MediaStream();
|
||||||
audioStream.addTrack(track.jsTrack);
|
audioStream.addTrack(track.jsTrack);
|
||||||
audioElement.srcObject = audioStream;
|
audioElement.srcObject = audioStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
void stopAudio(String id) {
|
void stopAudio(String id) {
|
||||||
var audioElement = html.document.getElementById(audioPrefix + id);
|
final audioElement = html.document.getElementById(audioPrefix + id);
|
||||||
if (audioElement != null) {
|
if (audioElement != null) {
|
||||||
if (audioElement is html.AudioElement) {
|
if (audioElement is html.AudioElement) {
|
||||||
audioElement.srcObject = null;
|
audioElement.srcObject = null;
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ class AudioTrack extends Track {
|
|||||||
|
|
||||||
/// Start playing audio track. On web platform, create an audio element and
|
/// Start playing audio track. On web platform, create an audio element and
|
||||||
/// start playback
|
/// start playback
|
||||||
start() {
|
void start() {
|
||||||
if (!(this is LocalAudioTrack)) {
|
if (this is! LocalAudioTrack) {
|
||||||
audio.startAudio(getCid(), mediaTrack);
|
audio.startAudio(getCid(), mediaTrack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
stop() {
|
void stop() {
|
||||||
mediaStream?.dispose();
|
mediaStream?.dispose();
|
||||||
mediaStream = null;
|
mediaStream = null;
|
||||||
audio.stopAudio(getCid());
|
audio.stopAudio(getCid());
|
||||||
|
|||||||
@@ -9,19 +9,18 @@ class LocalAudioTrack extends AudioTrack {
|
|||||||
: super(name, track, stream);
|
: super(name, track, stream);
|
||||||
|
|
||||||
/// Creates a new audio track from the default audio input device.
|
/// Creates a new audio track from the default audio input device.
|
||||||
static Future<LocalAudioTrack> createTrack(
|
static Future<LocalAudioTrack> createTrack([LocalAudioTrackOptions? options]) async {
|
||||||
[LocalAudioTrackOptions? options]) async {
|
|
||||||
try {
|
try {
|
||||||
var stream = await navigator.mediaDevices.getUserMedia({
|
final stream = await navigator.mediaDevices.getUserMedia(<String, dynamic>{
|
||||||
"audio": true,
|
'audio': true,
|
||||||
"video": false,
|
'video': false,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (stream.getAudioTracks().length == 0) {
|
if (stream.getAudioTracks().isEmpty) {
|
||||||
return Future.error(TrackCreateError());
|
return Future.error(TrackCreateError());
|
||||||
}
|
}
|
||||||
|
|
||||||
return LocalAudioTrack("", stream.getAudioTracks().first, stream);
|
return LocalAudioTrack('', stream.getAudioTracks().first, stream);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Future.error(e);
|
return Future.error(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ import 'track.dart';
|
|||||||
import 'track_publication.dart';
|
import 'track_publication.dart';
|
||||||
|
|
||||||
class LocalTrackPublication extends TrackPublication {
|
class LocalTrackPublication extends TrackPublication {
|
||||||
LocalParticipant _participant;
|
final LocalParticipant _participant;
|
||||||
|
|
||||||
LocalTrackPublication(TrackInfo info, Track track, this._participant)
|
LocalTrackPublication(TrackInfo info, Track track, this._participant) : super.fromInfo(info) {
|
||||||
: super.fromInfo(info) {
|
|
||||||
this.track = track;
|
this.track = track;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Mute or unmute the current track. When muted, track will stop sending data
|
/// Mute or unmute the current track. When muted, track will stop sending data
|
||||||
|
@override
|
||||||
set muted(bool val) {
|
set muted(bool val) {
|
||||||
if (val == muted) {
|
if (val == muted) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -13,15 +13,12 @@ class LocalVideoTrack extends VideoTrack {
|
|||||||
: super(name, mediaTrack, stream);
|
: super(name, mediaTrack, stream);
|
||||||
|
|
||||||
/// Creates a LocalVideoTrack from camera input.
|
/// Creates a LocalVideoTrack from camera input.
|
||||||
static Future<LocalVideoTrack> createCameraTrack(
|
static Future<LocalVideoTrack> createCameraTrack([LocalVideoTrackOptions? options]) async {
|
||||||
[LocalVideoTrackOptions? options]) async {
|
options ??= LocalVideoTrackOptions(params: VideoPresets.qhd);
|
||||||
if (options == null) {
|
|
||||||
options = LocalVideoTrackOptions(params: VideoPresets.qhd);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var stream = await _createCameraStream(options);
|
final stream = await _createCameraStream(options);
|
||||||
return LocalVideoTrack("camera", stream.getVideoTracks().first, stream);
|
return LocalVideoTrack('camera', stream.getVideoTracks().first, stream);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Future.error(e);
|
return Future.error(e);
|
||||||
}
|
}
|
||||||
@@ -34,13 +31,11 @@ class LocalVideoTrack extends VideoTrack {
|
|||||||
return Future.error(TrackCreateError('could not restart track'));
|
return Future.error(TrackCreateError('could not restart track'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options == null) {
|
options ??= LocalVideoTrackOptions(params: VideoPresets.qhd);
|
||||||
options = LocalVideoTrackOptions(params: VideoPresets.qhd);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var stream = await _createCameraStream(options);
|
final stream = await _createCameraStream(options);
|
||||||
var track = stream.getVideoTracks().first;
|
final track = stream.getVideoTracks().first;
|
||||||
mediaStream = stream;
|
mediaStream = stream;
|
||||||
await mediaTrack.stop();
|
await mediaTrack.stop();
|
||||||
mediaTrack = track;
|
mediaTrack = track;
|
||||||
@@ -50,19 +45,16 @@ class LocalVideoTrack extends VideoTrack {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<MediaStream> _createCameraStream(
|
static Future<MediaStream> _createCameraStream(LocalVideoTrackOptions? options) async {
|
||||||
LocalVideoTrackOptions? options) async {
|
options ??= LocalVideoTrackOptions(params: VideoPresets.qhd);
|
||||||
if (options == null) {
|
|
||||||
options = LocalVideoTrackOptions(params: VideoPresets.qhd);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var stream = await navigator.mediaDevices.getUserMedia({
|
final stream = await navigator.mediaDevices.getUserMedia(<String, dynamic>{
|
||||||
"audio": false,
|
'audio': false,
|
||||||
"video": options.mediaConstraints,
|
'video': options.mediaConstraints,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (stream.getVideoTracks().length == 0) {
|
if (stream.getVideoTracks().isEmpty) {
|
||||||
return Future.error(TrackCreateError());
|
return Future.error(TrackCreateError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -1,6 +1,6 @@
|
|||||||
/// Options when creating a LocalVideoTrack.
|
/// Options when creating a LocalVideoTrack.
|
||||||
class LocalVideoTrackOptions {
|
class LocalVideoTrackOptions {
|
||||||
CameraPosition position = CameraPosition.FRONT;
|
CameraPosition position = CameraPosition.front;
|
||||||
VideoParameter params;
|
VideoParameter params;
|
||||||
|
|
||||||
LocalVideoTrackOptions({
|
LocalVideoTrackOptions({
|
||||||
@@ -16,16 +16,16 @@ class LocalVideoTrackOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> get mediaConstraints {
|
Map<String, dynamic> get mediaConstraints {
|
||||||
return {
|
return <String, dynamic>{
|
||||||
"mandatory": params.mediaConstraints,
|
'mandatory': params.mediaConstraints,
|
||||||
"facingMode": position == CameraPosition.FRONT ? "user" : "environment",
|
'facingMode': position == CameraPosition.front ? 'user' : 'environment',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CameraPosition {
|
enum CameraPosition {
|
||||||
FRONT,
|
front,
|
||||||
BACK,
|
back,
|
||||||
}
|
}
|
||||||
|
|
||||||
class VideoParameter {
|
class VideoParameter {
|
||||||
@@ -38,14 +38,14 @@ class VideoParameter {
|
|||||||
this.width,
|
this.width,
|
||||||
this.height,
|
this.height,
|
||||||
this.fps, {
|
this.fps, {
|
||||||
int? bitrate,
|
this.bitrate,
|
||||||
}) : this.bitrate = bitrate;
|
});
|
||||||
|
|
||||||
Map<String, dynamic> get mediaConstraints {
|
Map<String, dynamic> get mediaConstraints {
|
||||||
return {
|
return <String, dynamic>{
|
||||||
"minWidth": this.width,
|
'minWidth': width,
|
||||||
"minHeight": this.height,
|
'minHeight': height,
|
||||||
"minFrameRate": this.fps,
|
'minFrameRate': fps,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import 'track_publication.dart';
|
|||||||
/// Represents a track publication from a RemoteParticipant. Provides methods to
|
/// Represents a track publication from a RemoteParticipant. Provides methods to
|
||||||
/// control if we should subscribe to the track, and its quality (for video).
|
/// control if we should subscribe to the track, and its quality (for video).
|
||||||
class RemoteTrackPublication extends TrackPublication {
|
class RemoteTrackPublication extends TrackPublication {
|
||||||
RemoteParticipant _participant;
|
final RemoteParticipant _participant;
|
||||||
bool _unsubscribed = false;
|
bool _unsubscribed = false;
|
||||||
bool _disabled = false;
|
bool _disabled = false;
|
||||||
VideoQuality _videoQuality = VideoQuality.HIGH;
|
VideoQuality _videoQuality = VideoQuality.HIGH;
|
||||||
@@ -26,6 +26,7 @@ class RemoteTrackPublication extends TrackPublication {
|
|||||||
_sendUpdateTrackSettings();
|
_sendUpdateTrackSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
bool get subscribed {
|
bool get subscribed {
|
||||||
if (_unsubscribed) {
|
if (_unsubscribed) {
|
||||||
return false;
|
return false;
|
||||||
@@ -41,6 +42,7 @@ class RemoteTrackPublication extends TrackPublication {
|
|||||||
|
|
||||||
/// for internal use
|
/// for internal use
|
||||||
/// {@nodoc}
|
/// {@nodoc}
|
||||||
|
@override
|
||||||
set muted(bool val) {
|
set muted(bool val) {
|
||||||
if (val == muted) {
|
if (val == muted) {
|
||||||
return;
|
return;
|
||||||
@@ -59,13 +61,12 @@ class RemoteTrackPublication extends TrackPublication {
|
|||||||
_participant.muteChanged();
|
_participant.muteChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteTrackPublication(TrackInfo info, this._participant, [Track? track])
|
RemoteTrackPublication(TrackInfo info, this._participant, [Track? track]) : super.fromInfo(info) {
|
||||||
: super.fromInfo(info) {
|
|
||||||
this.track = track;
|
this.track = track;
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendUpdateTrackSettings() {
|
void _sendUpdateTrackSettings() {
|
||||||
var settings = new UpdateTrackSettings(
|
final settings = UpdateTrackSettings(
|
||||||
trackSids: [sid],
|
trackSids: [sid],
|
||||||
disabled: _disabled,
|
disabled: _disabled,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class TrackDimension {
|
|||||||
|
|
||||||
/// Wrapper around a MediaStreamTrack with additional metadata.
|
/// Wrapper around a MediaStreamTrack with additional metadata.
|
||||||
class Track {
|
class Track {
|
||||||
static const ScreenShareName = "screen";
|
static const screenShareName = 'screen';
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
TrackType kind;
|
TrackType kind;
|
||||||
@@ -38,19 +38,17 @@ class Track {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getCid() {
|
String getCid() {
|
||||||
var cid = _cid;
|
var cid = _cid ?? mediaTrack.id;
|
||||||
|
|
||||||
if (cid == null) {
|
if (cid == null) {
|
||||||
cid = mediaTrack.id;
|
const uuid = Uuid();
|
||||||
}
|
|
||||||
if (cid == null) {
|
|
||||||
var uuid = Uuid();
|
|
||||||
cid = uuid.v4();
|
cid = uuid.v4();
|
||||||
_cid = cid;
|
_cid = cid;
|
||||||
}
|
}
|
||||||
return cid;
|
return cid;
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
void stop() {
|
||||||
mediaTrack.stop();
|
mediaTrack.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,15 +21,14 @@ class TrackPublication {
|
|||||||
updateFromInfo(info);
|
updateFromInfo(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// True when the track is published with name [Track.ScreenShareName].
|
/// True when the track is published with name [Track.screenShareName].
|
||||||
bool get isScreenShare =>
|
bool get isScreenShare => kind == TrackType.VIDEO && name == Track.screenShareName;
|
||||||
kind == TrackType.VIDEO && name == Track.ScreenShareName;
|
|
||||||
|
|
||||||
updateFromInfo(TrackInfo info) {
|
void updateFromInfo(TrackInfo info) {
|
||||||
muted = info.muted;
|
muted = info.muted;
|
||||||
simulcasted = info.simulcast;
|
simulcasted = info.simulcast;
|
||||||
if (info.type == TrackType.VIDEO) {
|
if (info.type == TrackType.VIDEO) {
|
||||||
dimension = new TrackDimension(info.width, info.height);
|
dimension = TrackDimension(info.width, info.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class PCTransport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> addIceCandidate(RTCIceCandidate candidate) async {
|
Future<void> addIceCandidate(RTCIceCandidate candidate) async {
|
||||||
var desc = await getRemoteDescription();
|
final desc = await getRemoteDescription();
|
||||||
if (desc != null && !restartingIce) {
|
if (desc != null && !restartingIce) {
|
||||||
return pc.addCandidate(candidate);
|
return pc.addCandidate(candidate);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,20 +45,20 @@ class _VideoTrackRendererState extends State<VideoTrackRenderer> {
|
|||||||
super.didUpdateWidget(oldWidget);
|
super.didUpdateWidget(oldWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
_trackChanged() {
|
void _trackChanged() {
|
||||||
setState(() {
|
setState(() {
|
||||||
_renderer.srcObject = widget.track.mediaStream;
|
_renderer.srcObject = widget.track.mediaStream;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_initRenderer() async {
|
void _initRenderer() async {
|
||||||
await _renderer.initialize();
|
await _renderer.initialize();
|
||||||
_trackChanged();
|
_trackChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var isLocal = widget.track is LocalVideoTrack;
|
final isLocal = widget.track is LocalVideoTrack;
|
||||||
return RTCVideoView(
|
return RTCVideoView(
|
||||||
_renderer,
|
_renderer,
|
||||||
mirror: isLocal,
|
mirror: isLocal,
|
||||||
|
|||||||
+21
-7
@@ -83,6 +83,13 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_lints:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: flutter_lints
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.4"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -109,6 +116,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "4.0.0"
|
||||||
|
lints:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: lints
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
logging:
|
logging:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -150,14 +164,14 @@ packages:
|
|||||||
name: path_provider_linux
|
name: path_provider_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.2"
|
||||||
path_provider_macos:
|
path_provider_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_macos
|
name: path_provider_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.2"
|
||||||
path_provider_platform_interface:
|
path_provider_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -171,7 +185,7 @@ packages:
|
|||||||
name: path_provider_windows
|
name: path_provider_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.3"
|
||||||
pedantic:
|
pedantic:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -185,7 +199,7 @@ packages:
|
|||||||
name: platform
|
name: platform
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.2"
|
||||||
plugin_platform_interface:
|
plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -199,7 +213,7 @@ packages:
|
|||||||
name: process
|
name: process
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.1"
|
version: "4.2.3"
|
||||||
protobuf:
|
protobuf:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -302,7 +316,7 @@ packages:
|
|||||||
name: win32
|
name: win32
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.5"
|
version: "2.2.7"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -312,4 +326,4 @@ packages:
|
|||||||
version: "0.2.0"
|
version: "0.2.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.13.0 <3.0.0"
|
dart: ">=2.13.0 <3.0.0"
|
||||||
flutter: ">=1.22.0"
|
flutter: ">=2.0.0"
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ dependencies:
|
|||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_lints: ^1.0.4
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|||||||
Reference in New Issue
Block a user