Skip to content
pubscout

subtitle_wrapper_package

2.2.1, released 3 years ago by jorandob.nl

Displays WebVTT and SubRip (.srt) subtitles for video players in Flutter.

$ flutter pub add subtitle_wrapper_package
Source repository

What it does

Wraps a video player widget to overlay subtitles parsed from remote URLs or local content strings. It supports dynamic updating of subtitles during playback, text styling, and parses both WebVTT and .srt formats.

AI-written summary of version 2.2.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display WebVTT or SubRip (.srt) subtitles on a video player in Flutter.
  • You want to load subtitles remotely via a URL or locally via a content string.
  • You require standard or advanced subtitle text styling such as custom fonts and colors.

Skip it when

  • You need to parse subtitle formats other than WebVTT or .srt.
  • You are not using a compatible video player controller setup.

Strengths

  • Supports the two most widely used subtitle formats (WebVTT and SubRip).
  • Allows dynamic updating of subtitles during playback.
  • Supports both UTF-8 and Latin-1 encoded remote subtitles.

Weaknesses

  • Requires you to explicitly specify the subtitle type (webvtt or srt).
  • Platform support is limited to Android, iOS, and macOS.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
6

Instantiate a SubtitleController with a subtitle URL or content string and type, then wrap your video player with the SubTitleWrapper widget.

final SubtitleController subtitleController = SubtitleController(
    subtitleUrl: "https://pastebin.com/raw/ZWWAL7fK",
    subtitleType: SubtitleType.webvtt;
);

SubtitleWrapper(
    videoPlayerController: videoPlayerController,
    subtitleController: subtitleController,
    subtitleStyle: SubtitleStyle(
        textColor: Colors.white,
        hasBorder: true,
    ),
    videoChild: Chewie(
        controller: chewieController,
    ),
);

Alternatives

Packages that do the same job and could replace subtitle_wrapper_package.

Works with

Packages commonly used together with subtitle_wrapper_package: ones it builds on, ones built on it, and its own family.