IMediaPlayerCustomSourceProvider class

Inheritance
  • Object
  • NativeClass
  • NativeObserverClass
  • IMediaPlayerCustomSourceProvider
Implementers

Constructors

IMediaPlayerCustomSourceProvider([NativeClassOptions? options])

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 Callback of getting the path and size of the audio data you input.
When you call openWithCustomSource{@link #IMediaPlayer#openWithCustomSource} API to play the in-memory audio data you input, this callback will be triggered and you need to enter the path and size of the audio data. @param buffer The path of the audio data you input. The size of audio data should be equal to or less than the value of bufferSize. The supported formats are: mp3, aac, m4a, 3gp, wav. @param bufferSize The size of the audio data, in bytes. If you want to stop audio playing, you can enter a figure less than or equal to zero into bufferSize and then SDK will stop calling this callback. @return Returns the size of the audio data that are actually read. @note If calling openWithCustomSource{@link #IMediaPlayer#openWithCustomSource} API failed, please enter 0 into buffer and bufferSize. In this situation, SDK will stop calling this callback.
onSeek(long offset, MediaPlayerCustomSourceSeekWhence whence) FutureOr<long>
@valid since 3.53 @detail callback @author songxiaomeng.19 @brief Seeking the audio data based on the set starting position and offset to help SDK read and analyze data.
When you call openWithCustomSource{@link #IMediaPlayer#openWithCustomSource} API to play the in-memory audio data you input, or when you call setPosition{@link #IMediaPlayer#setPosition} to set the starting position of audio playing, this callback will be trigerred and you need to seek the audio data accorring to the value of offset and whence. @param offset The offset of the target position relative to the starting position, in bytes. The value can be positive or negative. @param whence The starting position of the seeking. Refer to MediaPlayerCustomSourceSeekWhence{@link #MediaPlayerCustomSourceSeekWhence} for more details. @return If the seeking succeeded, the information on the final adjusted play position after seeking or the size of the audio data will be returned.
If the seeking failed, -1 will be returned.
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

Static Properties

codegen_$namespace → dynamic
no setter