seekToTimeMs method
seek to time.
- time Unit: milliseconds.
- seekCompleted
- seekRenderCompleted
Implementation
Future<void> seekToTimeMs(
{required double time, void Function(bool)? seekCompleted, void Function()? seekRenderCompleted}) async {
_seekSerialNo += 1;
final callbackId = '${hashCode}_$_seekSerialNo';
if (seekCompleted != null) {
if (_seekCompletedCallbacks[hashCode] == null) {
_seekCompletedCallbacks[hashCode] = {};
}
_seekCompletedCallbacks[hashCode]![callbackId] = seekCompleted;
}
if (seekRenderCompleted != null) {
if (_seekRenderCompletedCallbacks[hashCode] == null) {
_seekRenderCompletedCallbacks[hashCode] = {};
}
_seekRenderCompletedCallbacks[hashCode]![callbackId] = seekRenderCompleted;
}
await engineInstanceMethodChannel.invokeMethod('setCurrentPlaybackTime', {
'time': time,
'seekSerialNo': _seekSerialNo,
});
}