MediaSource class
Information and playback settings for the media file to be played.
- Annotations
-
- @JsonSerializable.new(explicitToJson: true, includeIfNull: false)
Properties
- autoPlay → bool?
-
If you disable autoplay, call the play method to play the media file after opening it. Whether to enable autoplay after opening the media file: true : (default) Enable autoplay. false : Disable autoplay.
final
- enableCache → bool?
-
The SDK currently only supports caching for on-demand streams, not for on-demand streams transmitted via HLS protocol.
Before caching, assign a value to uri, otherwise the player uses the media file's url as the cache index.
After enabling real-time caching, the player pre-caches part of the currently playing media file locally. When you play the file again, the player loads data from the cache, saving network traffic. The statistics of the currently cached media file are updated every second after playback starts. See CacheStatistics. Whether to enable real-time caching for this playback: true : Enable real-time caching. false : (default) Disable real-time caching.
final
- enableMultiAudioTrack → bool?
-
Whether to allow selecting different audio tracks for this playback: true : Allow selecting different audio tracks. false : (default) Do not allow selecting different audio tracks. If you need to set different audio tracks for local playback and publishing to remote, set this parameter to true and then call the selectMultiAudioTrack method to set the audio track.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAgoraSource → bool?
-
If the media resource to be opened is a live or on-demand stream distributed via Agora Fusion CDN, pass the stream URL to url and set isAgoraSource to true. Otherwise, you do not need to set isAgoraSource. Whether the opened media resource is a live or on-demand stream distributed via Agora Fusion CDN: true : The media resource is a live or on-demand stream distributed via Agora Fusion CDN. false : (default) The media resource is not distributed via Agora Fusion CDN.
final
- isLiveSource → bool?
-
Only when the media resource is a live stream, setting isLiveSource to true can speed up opening the media resource. Whether the opened media resource is a live stream: true : Live stream. false : (default) Not a live stream. If the media resource is a live stream, it is recommended to set this parameter to true to speed up the opening of the live stream.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startPos → int?
-
Start playback position in milliseconds. Default is 0.
final
- uri → String?
-
URI (Uniform Resource Identifier) of the media file, used to identify the media file.
final
- url → String?
-
URL of the media resource to be played.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited