Update README.md

This commit is contained in:
Hiroshi Horie
2022-03-03 10:27:43 +09:00
parent 811ded7aa6
commit c2c1a7dd79
+8 -12
View File
@@ -101,19 +101,18 @@ On Windows [VS 2019](https://visualstudio.microsoft.com/thank-you-downloading-vi
### Connecting to a room, publish video & audio ### Connecting to a room, publish video & audio
```dart ```dart
var options = ConnectOptions( final roomOptions = RoomOptions(
autoSubscribe: false, adaptiveStream: true,
optimizeVideo: true, dynacast: true,
defaultVideoPublishOptions: VideoPublishOptions( // ... your room options
simulcast: true,
),
) )
var room = await LiveKitClient.connect(url, token, options: options);
final room = await LiveKitClient.connect(url, token, roomOptions: roomOptions);
try { try {
// video will fail when running in ios simulator // video will fail when running in ios simulator
await room.localParticipant.setCameraEnabled(true); await room.localParticipant.setCameraEnabled(true);
} catch (e) { } catch (error) {
print('could not publish video: $e'); print('Could not publish video, error: $error');
} }
await room.localParticipant.setMicrophoneEnabled(true); await room.localParticipant.setMicrophoneEnabled(true);
@@ -286,9 +285,6 @@ class _VideoViewState extends State<VideoView> {
setState(() { setState(() {
if (subscribedVideos.length > 0) { if (subscribedVideos.length > 0) {
var videoPub = subscribedVideos.first; var videoPub = subscribedVideos.first;
if (videoPub is RemoteTrackPublication) {
videoPub.videoQuality = widget.quality;
}
// when muted, show placeholder // when muted, show placeholder
if (!videoPub.muted) { if (!videoPub.muted) {
this.videoPub = videoPub; this.videoPub = videoPub;