|
Agora Java API Reference for Android
|
The media player custom data provider interface. More...
Public Member Functions | |
| int | onReadData (ByteBuffer buffer, int bufferSize) |
| Occurs when the SDK reads the media resource data. More... | |
| long | onSeek (long offset, int whence) |
| Occurs when the SDK seeks the media resource data. More... | |
The media player custom data provider interface.
| int io.agora.mediaplayer.IMediaPlayerCustomDataProvider.onReadData | ( | ByteBuffer | buffer, |
| int | bufferSize | ||
| ) |
Occurs when the SDK reads the media resource data.
When you call the openWithMediaSource method to open a media resource, the SDK triggers this callback and request you to pass in the buffer of the media resource data.
| buffer | An input parameter. Data buffer (bytes). Write the bufferSize data reported by the SDK into this parameter. |
| bufferSize | The length of the data buffer (bytes). |
| long io.agora.mediaplayer.IMediaPlayerCustomDataProvider.onSeek | ( | long | offset, |
| int | whence | ||
| ) |
Occurs when the SDK seeks the media resource data.
When you call the openWithMediaSource or open(String url, long startPos) method to open a custom media resource, the SDK triggers this callback to request the specified location in the media resource.
| offset | An input parameter. The offset of the target position relative to the starting point, in bytes. The value can be positive or negative. |
| whence | An input parameter. The starting point. You can set it as one of the following values:
|
whence is 65536, the media file size is returned.whence is 0, 1, or 2, the actual data offset after the seeking is returned.
1.8.18