Use high level track APIs in example app & docs (#36)
This commit is contained in:
@@ -26,7 +26,7 @@ class _ConnectPageState extends State<ConnectPage> {
|
||||
|
||||
final _uriCtrl = TextEditingController();
|
||||
final _tokenCtrl = TextEditingController();
|
||||
bool _simulcast = false;
|
||||
bool _simulcast = true;
|
||||
bool _busy = false;
|
||||
|
||||
@override
|
||||
@@ -48,7 +48,7 @@ class _ConnectPageState extends State<ConnectPage> {
|
||||
_uriCtrl.text = prefs.getString(_storeKeyUri) ?? '';
|
||||
_tokenCtrl.text = prefs.getString(_storeKeyToken) ?? '';
|
||||
setState(() {
|
||||
_simulcast = prefs.getBool(_storeKeySimulcast) ?? false;
|
||||
_simulcast = prefs.getBool(_storeKeySimulcast) ?? true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -68,19 +68,17 @@ class _RoomPageState extends State<RoomPage> {
|
||||
if (result != true) return;
|
||||
// video will fail when running in ios simulator
|
||||
try {
|
||||
// Create video track
|
||||
final localVideo = await LocalVideoTrack.createCameraTrack();
|
||||
// Try to publish the video
|
||||
await widget.room.localParticipant.publishVideoTrack(localVideo);
|
||||
|
||||
// Create mic track
|
||||
final localAudio = await LocalAudioTrack.create();
|
||||
// // Try to publish audio
|
||||
await widget.room.localParticipant.publishAudioTrack(localAudio);
|
||||
await widget.room.localParticipant.setCameraEnabled(true);
|
||||
} catch (error) {
|
||||
print('could not publish video: $error');
|
||||
await context.showErrorDialog(error);
|
||||
}
|
||||
try {
|
||||
await widget.room.localParticipant.setMicrophoneEnabled(true);
|
||||
} catch (error) {
|
||||
print('could not publish audio: $error');
|
||||
await context.showErrorDialog(error);
|
||||
}
|
||||
}
|
||||
|
||||
void _onRoomDidUpdate() {
|
||||
|
||||
Reference in New Issue
Block a user