option docs

This commit is contained in:
Hiroshi Horie
2021-12-12 18:32:34 +07:00
parent 93d0bc0c19
commit 8041f45def
3 changed files with 26 additions and 12 deletions
+2 -1
View File
@@ -1,8 +1,9 @@
import 'package:logging/logging.dart';
/// Logger used for the entire SDK. To output logs, configure the logger at the
/// entry point of your app. Adjust the logger output level to your needs.
/// A typical configuration would look like the following:
///
///
/// Logger.root.level = Level.FINE;
/// Logger.root.onRecord.listen((record) {
/// print('${record.level.name}: ${record.message}');
+22 -9
View File
@@ -1,11 +1,20 @@
import 'track/options.dart';
import 'track/track.dart';
import 'publication/remote_track_publication.dart';
import 'types.dart';
import 'room.dart';
/// Options used when connecting to the server.
class ConnectOptions {
/// Auto-subscribe to room tracks upon connect, defaults to true.
/// Auto-subscribe to existing and new [RemoteTrackPublication]s after
/// successfully connecting to the [Room].
/// Defaults to true.
final bool autoSubscribe;
/// The default [RTCConfiguration] to be used.
final RTCConfiguration rtcConfiguration;
/// The protocol version to be used. Usually this doesn't need to be modified.
final ProtocolVersion protocolVersion;
const ConnectOptions({
@@ -15,13 +24,13 @@ class ConnectOptions {
});
}
/// Options when joining a room.
/// Options used to modify the behavior of the [Room].
/// {@category Room}
class RoomOptions {
/// Default options used when publishing a video track
/// Default options used when publishing a video track.
final VideoPublishOptions defaultVideoPublishOptions;
/// Default options used when publishing a audio track
/// Default options used when publishing a audio track.
final AudioPublishOptions defaultAudioPublishOptions;
/// When this is turned on, the following optimizations will be made:
@@ -29,12 +38,12 @@ class RoomOptions {
/// [VideoTrackRenderer]'s visibility on screen.
/// - Re-sizing a [VideoTrackRenderer] will signal the server to send down
/// a relavant quality layer (if simulcast is enabled on the publisher)
/// defaults to true.
/// Defaults to true.
final bool optimizeVideo;
/// Set this to false in case you would like to stop the track yourself.
/// If you set this to false, make sure you call [Track.stop].
/// defaults to true.
/// Defaults to true.
final bool stopLocalTrackOnUnpublish;
const RoomOptions({
@@ -45,13 +54,16 @@ class RoomOptions {
});
}
/// Options used when publishing video.
class VideoPublishOptions {
///
/// If provided, this will be used instead of the SDK's suggested encodings.
/// Usually you don't need to provide this.
/// Defaults to null.
final VideoEncoding? videoEncoding;
/// Whether to enable simulcast or not.
/// https://blog.livekit.io/an-introduction-to-webrtc-simulcast-6c5f1f6402eb
/// defaults to true.
/// Defaults to true.
final bool simulcast;
const VideoPublishOptions({
@@ -64,10 +76,11 @@ class VideoPublishOptions {
'${runtimeType}(videoEncoding: ${videoEncoding}, simulcast: ${simulcast})';
}
/// Options used when publishing audio.
class AudioPublishOptions {
/// Whether to enable DTX (Discontinuous Transmission) or not.
/// https://en.wikipedia.org/wiki/Discontinuous_transmission
/// defaults to true.
/// Defaults to true.
final bool dtx;
const AudioPublishOptions({
+2 -2
View File
@@ -71,11 +71,11 @@ abstract class LocalVideoTrackOptions extends LocalTrackOptions {
class VideoEncoding {
final int maxFramerate;
final int? maxBitrate;
final int maxBitrate;
const VideoEncoding({
required this.maxFramerate,
this.maxBitrate,
required this.maxBitrate,
});
@override