MediaSource class

Information related to the media file to be played and the playback scenario configurations.

Annotations
  • @JsonSerializable(explicitToJson: true, includeIfNull: false)

Properties

autoPlay bool?
Whether to enable autoplay once the media file is opened: true : (Default) Enables autoplay. false : Disables autoplay. If autoplay is disabled, you need to call the play method to play a media file after it is opened.
final
enableCache bool?
Whether to cache the media file when it is being played: true :Enables caching. false : (Default) Disables caching. Agora only supports caching on-demand audio and video streams that are not transmitted in HLS protocol. If you need to enable caching, pass in a value to uri; otherwise, caching is based on the url of the media file. If you enable this function, the Media Player caches part of the media file being played on your local device, and you can play the cached media file without internet connection. The statistics about the media file being cached are updated every second after the media file is played. See CacheStatistics.
final
enableMultiAudioTrack bool?
Whether to allow the selection of different audio tracks when playing this media file: true : Allow to select different audio tracks. false : (Default) Do not allow to select different audio tracks. If you need to set different audio tracks for local playback and publishing to the channel, you need to set this parameter to true, and then call the selectMultiAudioTrack method to select the audio track.
final
hashCode int
The hash code for this object.
no setterinherited
isAgoraSource bool?
Whether the media resource to be opened is a live stream or on-demand video distributed through Media Broadcast service: true : The media resource to be played is a live or on-demand video distributed through Media Broadcast service. false : (Default) The media resource is not a live stream or on-demand video distributed through Media Broadcast service. If you need to open a live stream or on-demand video distributed through Broadcast Streaming service, pass in the URL of the media resource to url, and set isAgoraSource as true; otherwise, you don't need to set the isAgoraSource parameter.
final
isLiveSource bool?
Whether the media resource to be opened is a live stream: true : The media resource is a live stream. false : (Default) The media resource is not a live stream. If the media resource you want to open is a live stream, Agora recommends that you set this parameter as true so that the live stream can be loaded more quickly. If the media resource you open is not a live stream, but you set isLiveSource as true, the media resource is not to be loaded more quickly.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startPos int?
The starting position (ms) for playback. The default value is 0.
final
uri String?
The URI (Uniform Resource Identifier) of the media file.
final
url String?
The URL of the media file to be played.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited