subtitle_wrapper_package
2.2.1, released 3 years ago by jorandob.nl
Displays WebVTT and SubRip (.srt) subtitles for video players in Flutter.
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.
- video_player_android
Android implementation of the video_player plugin
88Compare - video_player_avfoundation
iOS and macOS implementation of the video_player plugin
86Compare - video_player_tizen
Tizen implementation of the video_player plugin.
71Compare - youtube_player_iframe
Flutter widget for embedding YouTube videos via the official iFrame API
94Compare
Works with
Packages commonly used together with subtitle_wrapper_package: ones it builds on, ones built on it, and its own family.
- http_parsersubtitle_wrapper_package depends on itA platform-independent package for parsing and serializing HTTP formats.
- equatablesubtitle_wrapper_package depends on itProvides value‑based equality for Dart objects without manual == and hashCode.
- video_playersubtitle_wrapper_package depends on itFlutter plugin for displaying inline video on Android, iOS, macOS, and web.
- blocsubtitle_wrapper_package depends on itA Dart library for implementing the BLoC pattern with Cubits and Blocs.
- flutter_blocsubtitle_wrapper_package depends on itFlutter widgets to easily integrate blocs and cubits for state management.