seekMusicToPosInMS method

Future<void> seekMusicToPosInMS(
  1. int id,
  2. int pts
)

Set the playback progress of background music in milliseconds

Note: do not call this API frequently, as this API may repeatedly read and write the music file, which is time-consuming. When this API is used together with the progress bar, call this API in the callback triggered after the progress bar is dragged. Do not call this API when the progress bar is being dragged.

Parameters:

id Music track ID

pts Unit: ms

Platform not supported:

  • web

Implementation

Future<void> seekMusicToPosInMS(int id, int pts) {
  return _channel.invokeMethod('seekMusicToPosInMS', {"id": id, "pts": pts});
}