setPosition method
@detail api
@brief Sets the starting playback position of the media file.
@param position The starting position of the media file in milliseconds.
You can get the total duration of the media file through getTotalDuration{@link #ByteRTCMediaPlayer#getTotalDuration}. The value of position should be less than the total duration of the media file.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
- The API is valid for audio file, not PCM data.
- When playing online files, calling this API may cause playback delay.
Implementation
FutureOr<int> setPosition(int position) async {
return await nativeCall('setPosition:', [position]);
}