Skip to content

[video_player] update periodic timer duration to be public #160855

@abdelaziz-mahdy

Description

@abdelaziz-mahdy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions