option docs
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
/// Logger used for the entire SDK. To output logs, configure the logger at the
|
/// 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.
|
/// entry point of your app. Adjust the logger output level to your needs.
|
||||||
/// A typical configuration would look like the following:
|
/// A typical configuration would look like the following:
|
||||||
|
|||||||
+22
-9
@@ -1,11 +1,20 @@
|
|||||||
import 'track/options.dart';
|
import 'track/options.dart';
|
||||||
import 'track/track.dart';
|
import 'track/track.dart';
|
||||||
|
import 'publication/remote_track_publication.dart';
|
||||||
import 'types.dart';
|
import 'types.dart';
|
||||||
|
import 'room.dart';
|
||||||
|
|
||||||
|
/// Options used when connecting to the server.
|
||||||
class ConnectOptions {
|
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;
|
final bool autoSubscribe;
|
||||||
|
|
||||||
|
/// The default [RTCConfiguration] to be used.
|
||||||
final RTCConfiguration rtcConfiguration;
|
final RTCConfiguration rtcConfiguration;
|
||||||
|
|
||||||
|
/// The protocol version to be used. Usually this doesn't need to be modified.
|
||||||
final ProtocolVersion protocolVersion;
|
final ProtocolVersion protocolVersion;
|
||||||
|
|
||||||
const ConnectOptions({
|
const ConnectOptions({
|
||||||
@@ -15,13 +24,13 @@ class ConnectOptions {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Options when joining a room.
|
/// Options used to modify the behavior of the [Room].
|
||||||
/// {@category Room}
|
/// {@category Room}
|
||||||
class RoomOptions {
|
class RoomOptions {
|
||||||
/// Default options used when publishing a video track
|
/// Default options used when publishing a video track.
|
||||||
final VideoPublishOptions defaultVideoPublishOptions;
|
final VideoPublishOptions defaultVideoPublishOptions;
|
||||||
|
|
||||||
/// Default options used when publishing a audio track
|
/// Default options used when publishing a audio track.
|
||||||
final AudioPublishOptions defaultAudioPublishOptions;
|
final AudioPublishOptions defaultAudioPublishOptions;
|
||||||
|
|
||||||
/// When this is turned on, the following optimizations will be made:
|
/// When this is turned on, the following optimizations will be made:
|
||||||
@@ -29,12 +38,12 @@ class RoomOptions {
|
|||||||
/// [VideoTrackRenderer]'s visibility on screen.
|
/// [VideoTrackRenderer]'s visibility on screen.
|
||||||
/// - Re-sizing a [VideoTrackRenderer] will signal the server to send down
|
/// - Re-sizing a [VideoTrackRenderer] will signal the server to send down
|
||||||
/// a relavant quality layer (if simulcast is enabled on the publisher)
|
/// a relavant quality layer (if simulcast is enabled on the publisher)
|
||||||
/// defaults to true.
|
/// Defaults to true.
|
||||||
final bool optimizeVideo;
|
final bool optimizeVideo;
|
||||||
|
|
||||||
/// Set this to false in case you would like to stop the track yourself.
|
/// 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].
|
/// If you set this to false, make sure you call [Track.stop].
|
||||||
/// defaults to true.
|
/// Defaults to true.
|
||||||
final bool stopLocalTrackOnUnpublish;
|
final bool stopLocalTrackOnUnpublish;
|
||||||
|
|
||||||
const RoomOptions({
|
const RoomOptions({
|
||||||
@@ -45,13 +54,16 @@ class RoomOptions {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Options used when publishing video.
|
||||||
class VideoPublishOptions {
|
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;
|
final VideoEncoding? videoEncoding;
|
||||||
|
|
||||||
/// Whether to enable simulcast or not.
|
/// Whether to enable simulcast or not.
|
||||||
/// https://blog.livekit.io/an-introduction-to-webrtc-simulcast-6c5f1f6402eb
|
/// https://blog.livekit.io/an-introduction-to-webrtc-simulcast-6c5f1f6402eb
|
||||||
/// defaults to true.
|
/// Defaults to true.
|
||||||
final bool simulcast;
|
final bool simulcast;
|
||||||
|
|
||||||
const VideoPublishOptions({
|
const VideoPublishOptions({
|
||||||
@@ -64,10 +76,11 @@ class VideoPublishOptions {
|
|||||||
'${runtimeType}(videoEncoding: ${videoEncoding}, simulcast: ${simulcast})';
|
'${runtimeType}(videoEncoding: ${videoEncoding}, simulcast: ${simulcast})';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Options used when publishing audio.
|
||||||
class AudioPublishOptions {
|
class AudioPublishOptions {
|
||||||
/// Whether to enable DTX (Discontinuous Transmission) or not.
|
/// Whether to enable DTX (Discontinuous Transmission) or not.
|
||||||
/// https://en.wikipedia.org/wiki/Discontinuous_transmission
|
/// https://en.wikipedia.org/wiki/Discontinuous_transmission
|
||||||
/// defaults to true.
|
/// Defaults to true.
|
||||||
final bool dtx;
|
final bool dtx;
|
||||||
|
|
||||||
const AudioPublishOptions({
|
const AudioPublishOptions({
|
||||||
|
|||||||
@@ -71,11 +71,11 @@ abstract class LocalVideoTrackOptions extends LocalTrackOptions {
|
|||||||
|
|
||||||
class VideoEncoding {
|
class VideoEncoding {
|
||||||
final int maxFramerate;
|
final int maxFramerate;
|
||||||
final int? maxBitrate;
|
final int maxBitrate;
|
||||||
|
|
||||||
const VideoEncoding({
|
const VideoEncoding({
|
||||||
required this.maxFramerate,
|
required this.maxFramerate,
|
||||||
this.maxBitrate,
|
required this.maxBitrate,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user