callBackWhenVideoTimeUpdate method

void callBackWhenVideoTimeUpdate({
  1. required dynamic onVideoTimeUpdate(
    1. double currentTime
    )?,
})

Implementation

void callBackWhenVideoTimeUpdate({
  required Function(double currentTime)? onVideoTimeUpdate,
}) {
  controller.addJavaScriptHandler(
    handlerName: 'onVideoTimeUpdate',
    callback: (args) {
      final currentTime = args.first as double;
      onVideoTimeUpdate?.call(currentTime);
      print('<<< Current video time: $currentTime seconds >>>');
      return null;
    },
  );
}