seek abstract method

Future<void> seek(
  1. int newPos
)

Seeks to the specified playback position in the media file.

If you call seek after playback has completed (i.e., you received the onPlayerSourceStateChanged callback reporting the playback state as playerStatePlaybackCompleted or playerStatePlaybackAllLoopsCompleted), the SDK will automatically start playback from the specified position upon success. You will receive the onPlayerSourceStateChanged callback reporting the state as playerStatePlaying. If you call seek while playback is paused, the SDK will seek to the specified position upon success. To start playback, call resume or play.

  • newPos The specified position (in milliseconds).

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> seek(int newPos);