Skip to content

Commit

Permalink
[doc] daily update 2023-6-12
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and littleGnAl committed Jun 13, 2023
1 parent 8fcadea commit 4f430c4
Show file tree
Hide file tree
Showing 15 changed files with 1,596 additions and 1,184 deletions.
186 changes: 100 additions & 86 deletions lib/src/agora_base.dart

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/src/agora_log.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class LogConfig {
@JsonKey(name: 'fileSizeInKB')
final int? fileSizeInKB;

/// The output level of the SDK log file. See LogLevel .For example, if you set the log level to WARN, the SDK outputs the logs within levels FATAL, ERROR, and WARN.
/// The output level of the SDK log file. See LogLevel.For example, if you set the log level to WARN, the SDK outputs the logs within levels FATAL, ERROR, and WARN.
@JsonKey(name: 'level')
final LogLevel? level;

Expand Down
89 changes: 52 additions & 37 deletions lib/src/agora_media_base.dart

Large diffs are not rendered by default.

71 changes: 37 additions & 34 deletions lib/src/agora_media_engine.dart

Large diffs are not rendered by default.

158 changes: 93 additions & 65 deletions lib/src/agora_media_player.dart

Large diffs are not rendered by default.

23 changes: 15 additions & 8 deletions lib/src/agora_media_player_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,51 @@ class MediaPlayerSourceObserver {
});

/// Reports the changes of playback state.
///
/// When the state of the media player changes, the SDK triggers this callback to report the current playback state.
///
/// * [state] The playback state. See MediaPlayerState .
/// * [ec] The error code. See MediaPlayerError .
/// * [state] The playback state. See MediaPlayerState.
/// * [ec] The error code. See MediaPlayerError.
final void Function(MediaPlayerState state, MediaPlayerError ec)?
onPlayerSourceStateChanged;

/// Reports current playback progress.
///
/// When playing media files, the SDK triggers this callback every two second to report current playback progress.
///
/// * [position] The playback position (ms) of media files.
final void Function(int positionMs)? onPositionChanged;

/// Reports the player events.
///
/// After calling the seek method, the SDK triggers the callback to report the results of the seek operation.
///
/// * [eventCode] The player events. See MediaPlayerEvent .
/// * [eventCode] The player events. See MediaPlayerEvent.
/// * [elapsedTime] The time (ms) when the event occurs.
/// * [message] Information about the event.
final void Function(
MediaPlayerEvent eventCode, int elapsedTime, String message)?
onPlayerEvent;

/// Occurs when the media metadata is received.
///
/// The callback occurs when the player receives the media metadata and reports the detailed information of the media metadata.
///
/// * [data] The detailed data of the media metadata.
/// * [length] The data length (bytes).
final void Function(Uint8List data, int length)? onMetaData;

/// Reports the playback duration that the buffered data can support.
/// When playing online media resources, the SDK triggers this callback every two seconds to report the playback duration that the currently buffered data can support.When the playback duration supported by the buffered data is less than the threshold (0 by default), the SDK returns playerEventBufferLow.When the playback duration supported by the buffered data is greater than the threshold (0 by default), the SDK returns playerEventBufferRecover.
///
/// When playing online media resources, the SDK triggers this callback every two seconds to report the playback duration that the currently buffered data can support. When the playback duration supported by the buffered data is less than the threshold (0 by default), the SDK returns playerEventBufferLow . When the playback duration supported by the buffered data is greater than the threshold (0 by default), the SDK returns playerEventBufferRecover .
///
/// * [playCachedBuffer] The playback duration (ms) that the buffered data can support.
final void Function(int playCachedBuffer)? onPlayBufferUpdated;

/// Reports the events of preloaded media resources.
///
/// * [src] The URL of the media resource.
/// * [event] Events that occur when media resources are preloaded. See PlayerPreloadEvent .
/// * [event] Events that occur when media resources are preloaded. See PlayerPreloadEvent.
final void Function(String src, PlayerPreloadEvent event)? onPreloadEvent;

/// @nodoc
Expand All @@ -68,17 +73,19 @@ class MediaPlayerSourceObserver {

/// Occurs when the video bitrate of the media resource changes.
///
/// * [from] Information about the video bitrate of the media resource being played. See SrcInfo .
/// * [to] Information about the changed video bitrate of media resource being played. See SrcInfo .
/// * [from] Information about the video bitrate of the media resource being played. See SrcInfo.
/// * [to] Information about the changed video bitrate of media resource being played. See SrcInfo.
final void Function(SrcInfo from, SrcInfo to)? onPlayerSrcInfoChanged;

/// Occurs when information related to the media player changes.
///
/// When the information about the media player changes, the SDK triggers this callback. You can use this callback for troubleshooting.
///
/// * [info] Information related to the media player. See PlayerUpdatedInfo .
/// * [info] Information related to the media player. See PlayerUpdatedInfo.
final void Function(PlayerUpdatedInfo info)? onPlayerInfoUpdated;

/// Reports the volume of the media player.
///
/// The SDK triggers this callback every 200 milliseconds to report the current volume of the media player.
///
/// * [volume] The volume of the media player. The value ranges from 0 to 255.
Expand Down
8 changes: 4 additions & 4 deletions lib/src/agora_media_player_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class PlayerStreamInfo {
@JsonKey(name: 'streamIndex')
final int? streamIndex;

/// The type of the media stream. See MediaStreamType .
/// The type of the media stream. See MediaStreamType.
@JsonKey(name: 'streamType')
final MediaStreamType? streamType;

Expand Down Expand Up @@ -388,7 +388,7 @@ class PlayerStreamInfo {
@JsonKey(name: 'audioBitsPerSample')
final int? audioBitsPerSample;

/// The total duration (s) of the media stream.
/// The total duration (ms) of the media stream.
@JsonKey(name: 'duration')
final int? duration;

Expand Down Expand Up @@ -487,7 +487,7 @@ class PlayerUpdatedInfo {
@JsonKey(name: 'deviceId')
final String? deviceId;

/// The statistics about the media file being cached.If you call the openWithMediaSource method and set enableCache as true, the statistics about the media file being cached is updated every second after the media file is played. See CacheStatistics .
/// The statistics about the media file being cached.If you call the openWithMediaSource method and set enableCache as true, the statistics about the media file being cached is updated every second after the media file is played. See CacheStatistics.
@JsonKey(name: 'cacheStatistics')
final CacheStatistics? cacheStatistics;

Expand Down Expand Up @@ -528,7 +528,7 @@ class MediaSource {
@JsonKey(name: 'autoPlay')
final bool? autoPlay;

/// 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 .
/// 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.
@JsonKey(name: 'enableCache')
final bool? enableCache;

Expand Down
Loading

0 comments on commit 4f430c4

Please sign in to comment.