setCaptionOffset method

void setCaptionOffset(
  1. Duration offset
)

Sets the caption offset.

The offset will be used when getting the correct caption for a specific position. The offset can be positive or negative.

The values will be handled as follows:

  • 0: This is the default behavior. No offset will be applied.
  • 0: The caption will have a negative offset. So you will get caption text from the past.

  • <0: The caption will have a positive offset. So you will get caption text from the future.

Implementation

void setCaptionOffset(Duration offset) {
  if (videoPlayerController == null) {
    customDebugPrint("setCaptionOffset: videoPlayerController is null");
    return;
  }
  videoPlayerController!.setCaptionOffset(offset);
}