onReadData method

FutureOr<int> onReadData(
  1. ByteBuffer buffer,
  2. int bufferSize
)

@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.

Implementation

FutureOr<int> onReadData(ByteBuffer buffer, int bufferSize) async {
  throw UnimplementedError();
}