open abstract method

Future<void> open({
  1. required String url,
  2. required int startPos,
})

Opens the media resource.

This method is called asynchronously. If you need to play a media file, make sure you receive the onPlayerSourceStateChanged callback reporting playerStateOpenCompleted before calling the play method to play the file.

  • url The path of the media file. Both local path and online path are supported.
  • startPos The starting position (ms) for playback. Default value is 0.

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.

Implementation

Future<void> open({required String url, required int startPos});