subtitle_wrapper 0.1.1 copy "subtitle_wrapper: ^0.1.1" to clipboard
subtitle_wrapper: ^0.1.1 copied to clipboard

A Subtitle Wrapper package, this subtitle wrapper package displays subtitles for implemented players.

Subtitles Wrapper #

The Subtitle Wrapper package provides an easy way to display subtitles for videos using the VLC player in a Flutter application. It supports multiple subtitle formats and allows for dynamic subtitle delay adjustments.

Features #

  • Display subtitles from SRT and WebVTT files.
  • Adjust subtitle delay dynamically.
  • Customize subtitle text style.

Getting Started #

Installation #

Add the following dependency to your pubspec.yaml:

Usage #

  1. Initialize the Subtitle Controller:

    Create an instance of SubtitleController with the desired subtitle URL and type.

    SubtitleController subtitleController = SubtitleController(
      subtitleUrl: 'https://example.com/subtitles.srt',
      subtitleType: SubtitleType.srt,
      subtitleDecoder: SubtitleDecoder.utf8,
    );
    
  2. Set up the VLC Player:

    Initialize the VlcPlayerController with the video URL.

    VlcPlayerController vlcPlayerController = VlcPlayerController.network(
      'http://example.com/video.mp4',
      autoPlay: true,
    );
    
  3. Use the Subtitles Wrapper:

    Wrap your VLC player with the SubtitleWrapper widget to display subtitles.

    startLine: 7
    endLine: 48
    
  4. Adjust Subtitles Delay:

    Use the addSubtitleDelay and removeSubtitleDelay methods to adjust the subtitle delay in milliseconds.

    startLine: 72
    endLine: 86
    

Example #

Here's a simple example of how to integrate the subtitle wrapper in your Flutter app:

References #

0
likes
150
points
69
downloads

Publisher

unverified uploader

Weekly Downloads

A Subtitle Wrapper package, this subtitle wrapper package displays subtitles for implemented players.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

bloc, equatable, flutter, flutter_bloc, flutter_vlc_player, http, http_parser

More

Packages that depend on subtitle_wrapper