搜索插件、代码仓与 APP 分类

插件详情v2.2.1

subtitle_wrapper_package

一个字幕包装器包,此字幕包装器包用于视频播放器显示字幕。

AndroidiOSmacOS
近 30 天下载
859
喜欢数
79
Pub 分数
140

安装插件

flutter pub add subtitle_wrapper_package

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

subtitle_wrapper_package 是一个 Flutter 插件,旨在为视频播放器显示字幕。它与 Flutter 的视频播放功能无缝集成,使开发者能够渲染与视频内容同步的时间文本叠加层。该包支持多种字幕格式,并提供了一个简洁、可自定义的界面来显示字幕。专为跨平台使用而设计,可在 Android、iOS 和 macOS 上运行,非常适合需要可访问且准确的字幕渲染的多媒体应用。

适合场景

  • 视频播放带字幕
  • 多语言视频应用
  • 媒体播放器中的可访问性功能
  • 教育视频平台
  • 实时流媒体字幕

主要特点

  • 定时字幕同步
  • 支持多种字幕格式
  • 跨平台兼容性
  • 可自定义字幕样式
  • 与视频播放器轻松集成

适合对象

  • 开发视频应用的开发者
  • 需要辅助功能支持的应用程序
  • 教育或语言学习平台
  • 媒体流服务

使用建议

  • 需要兼容的视频播放器设置
  • 字幕文件格式必须受支持
  • 仅限基本字幕渲染,不支持高级编辑

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

subtitle_wrapper_package

Test and (dry-run) publish package

codecov licence

Features

Subtitle playback for the 2 most widely used subtitle formats are supported currently which can be dynamically updated during playback from a url of content string. As well as basic styling of the subtitle text item.

The package is nearly completely unit tested and widget tests are in progress.

Function Description Implemented
Parse WebVTT Parsing of WebVtt subtitles. ✔
Parse SubRip (.srt) Parsing of SubRip subtitles. ✔
Remote loading utf8 encoded subtitles The parsing of subtitle files with the utf8 encoding from an url. ✔
Remote loading latin1 encoded subtitles The parsing of subtitle files with the latin1 encoding from an url. ✔
Dynamic updating of subtitle Update subtitle content during playback. ✔
Standard subtitle styling Standard styling of subtitle items. ✔
Advance subtitle styling Advance styling of subtitle items. Like custom fonts. ✔

Installation

The basic setup of the package is really straight forward, create a instance of SubtitleController with a subtitleUrl or subtitlesContent depending if your resource is remote or local.

Unfortunately currently its required to specify the subtitle type so webvtt or srt .

After this you need to wrap your video player with the SubTitleWrapper and add the SubtitleController and videoPlayerController to the SubTitleWrapper . That's it :tada:

 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,
       ),
	),

Example

Demonstrates how to use the subtitle_wrapper_package plugin.

See the example documentation for more information.

Changelog

See CHANGELOG.md.

Contributing

Feel free to contribute by opening issues and/or pull requests. Your feedback is very welcome!

License

MIT License

Copyright (c) [2019] [Joran Dob]

所属分类

依赖

依赖清单 6 项

源码仓库

使用此插件的项目

暂无相关数据。