|
Agora RTC Objective-C API Reference
Refactor
|
Public Member Functions | |
| virtual int | onReadData (unsigned char *buffer, int bufferSize)=0 |
| virtual int64_t | onSeek (int64_t offset, int whence)=0 |
The custom data source provides a data stream input callback, and the player will continue to call back this interface, requesting the user to fill in the data that needs to be played.
|
inlinevirtual |
|
pure virtual |
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). |
|
pure virtual |
Occurs when the SDK seeks the media resource data.
When you call the openWithMediaSource or open 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.