-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Use case
Currently, the code snippet:
Timer.periodic(
const Duration(milliseconds: 500),found at code, is configured with a periodic duration of 500 milliseconds. This introduces a delay when using internal captions, as the Timer only updates every 500 milliseconds.
In scenarios where subtitles are displayed for a short duration, such as 1 second, this delay can cause captions to either appear late or for an inconsistent duration (e.g., 500 milliseconds or less). This significantly impacts user experience, as subtitles may not align properly with the video, making it difficult for users to follow along.
Proposal
A potential solution is to expose a setter for the periodic duration. This setter would allow developers to adjust the timer's interval dynamically. When a new duration is provided, the setter would cancel the current timer and create a new one with the updated duration. This flexibility ensures that subtitle timing can be adjusted to match use cases requiring finer granularity, significantly improving the user experience by reducing delays and ensuring accurate subtitle display.