android_IMediaPlayerCustomSourceProvider class

Inheritance

Properties

$instance ↔ dynamic
getter/setter pairinherited
$resource → NativeResource
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
ready Future<void>
Whether the instance is initialized
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() → void
inherited
emit(String name, List args) → dynamic
inherited
nativeCall<T>(String method, [List? args, NativeMethodMeta? meta]) Future<T>
Call instance method
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onReadData(ByteBuffer buffer, int bufferSize) FutureOr<int>
@valid since 3.53 @detail callback @author songxiaomeng.19 @brief 调用 openWithCustomSource{@link #IMediaPlayer#openWithCustomSource} 接口播放用户传入的内存音频数据时,会触发此回调,用户需要写入音频数据。 @param buffer 内存地址。在该地址中写入音频数据,写入音频数据的大小不超过 bufferSize 中填入的数值。支持的音频数据格式有: mp3,aac,m4a,3gp,wav。 @param bufferSize 音频数据大小,单位为字节。如果你想停止播放内存音频数据,可在 bufferSize 中填入小于或等于 0 的数,此时 SDK 会停止调用此接口。 @return 返回实际读取的音频数据大小。 @note 若 openWithCustomSource{@link #IMediaPlayer#openWithCustomSource} 接口调用失败,请在 buffer 和 bufferSize 两个参数中填入 0。 此时 SDK 会停止调用此接口。
inherited
onSeek(long offset, MediaPlayerCustomSourceSeekWhence whence) FutureOr<long>
@valid since 3.53 @detail callback @author songxiaomeng.19 @brief 根据设置好的内存音频数据的读取位置和读取偏移量对音频数据进行偏移,以便 SDK 读取和分析音频数据。
在调用 openWithCustomSource{@link #IMediaPlayer#openWithCustomSource} 接口传入内存音频数据,或者调用 setPosition{@link #IMediaPlayer#setPosition} 设置了音频数据的起始播放位置后,SDK 会对音频数据进行读取和分析,此时会触发该回调,你需要根据参数中设置的起始读取位置和偏移量进行操作。 @param offset 音频数据读取偏移量,单位为字节,取值可正可负。 @param whence 音频数据的起始读取位置。参看 MediaPlayerCustomSourceSeekWhence{@link #MediaPlayerCustomSourceSeekWhence} @return 定位成功,返回偏移后的位置信息,或返回音频数据的大小。
定位失败,返回 -1。
inherited
registerEvent(String name, dynamic method) → void
inherited
sendInstanceGet<T>(String property) Future<T>
Get instance property
inherited
sendInstancePropertiesGet(dynamic nativeClass) Future<Map<String, dynamic>>
Get instance properties
inherited
sendInstanceSet(String property, dynamic value) Future<void>
Set instance property
inherited
toString() String
A string representation of this object.
inherited
updateInstance(dynamic instance) → void
inherited
updateResource(NativeResource resource) → void
inherited

Operators

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