Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ba9d27f
support SMPE-TT and sidebar subtitles
gin7773 Sep 29, 2025
819b07c
Correct subtitle duration
gin7773 Sep 29, 2025
c79d086
ignore avoid_print
gin7773 Sep 29, 2025
c026cfc
Merge branch 'master' into add_sidebar_subtitle
gin7773 Oct 11, 2025
2883e37
update version
gin7773 Oct 11, 2025
2aad2c9
fix review issues
gin7773 Oct 11, 2025
961bddb
Merge branch 'master' into add_sidebar_subtitle
gin7773 Nov 11, 2025
aa2b3ba
save temporary
gin7773 Nov 19, 2025
f89c875
save
gin7773 Nov 21, 2025
e1ac030
update subtitle style
gin7773 Nov 25, 2025
851f072
Merge branch 'master' into add_sidebar_subtitle
gin7773 Nov 25, 2025
5e04e66
fix dart analyze issue
gin7773 Nov 25, 2025
7ff2923
smpte subtitle parser fix: 1.save header buffer 2.fix picture format…
gin7773 Nov 28, 2025
c4def7f
Merge branch 'master' into add_sidebar_subtitle
gin7773 Dec 12, 2025
9678908
Fixed the issue with the subtitle font display and support for user-d…
gin7773 Dec 12, 2025
c052197
How to customize the subtitle style
gin7773 Dec 12, 2025
b3650fa
ignore print
gin7773 Dec 12, 2025
cb128dd
Merge branch 'master' into add_sidebar_subtitle
gin7773 Dec 19, 2025
35bff45
correct fontSize and textAlign
gin7773 Dec 19, 2025
bf028a3
Adjust font size and modify widget structure
gin7773 Dec 19, 2025
15464e5
Add UI functionality to display multi-line subtitles
gin7773 Dec 19, 2025
8934741
Analyzing multi-line subtitles
gin7773 Dec 24, 2025
6a9365f
Updated the library and sample code
gin7773 Dec 24, 2025
a4b3153
merge textsInfo, pictureInfo and move the subtitle event parsing into…
gin7773 Dec 25, 2025
63423ec
define a constant and fix dangling pointer issue
gin7773 Dec 25, 2025
e434686
extract a new class for subtitle info
gin7773 Dec 25, 2025
a8cf6da
extract a new class Captions
gin7773 Dec 26, 2025
d16d4e6
fix dart_analyze issue
gin7773 Dec 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 78 additions & 11 deletions packages/video_player_avplay/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class _App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 9,
length: 10,
child: Scaffold(
key: const ValueKey<String>('home_page'),
appBar: AppBar(
Expand All @@ -39,6 +39,7 @@ class _App extends StatelessWidget {
Tab(icon: Icon(Icons.cloud), text: 'Asset'),
Tab(icon: Icon(Icons.live_tv), text: 'Live'),
Tab(icon: Icon(Icons.local_florist), text: 'ChangeURLTest'),
Tab(icon: Icon(Icons.abc), text: 'PictureCaptionTest'),
],
),
),
Expand All @@ -53,6 +54,7 @@ class _App extends StatelessWidget {
_AssetVideo(),
_LiveRemoteVideo(),
_TestRemoteVideo(),
_PictureCaptionVideo(),
],
),
),
Expand Down Expand Up @@ -107,7 +109,7 @@ class _HlsRomoteVideoState extends State<_HlsRomoteVideo> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand All @@ -132,7 +134,7 @@ class _DashRomoteVideoState extends State<_DashRomoteVideo> {
<StreamingPropertyType, String>{
/// You can set multiple parameters at once, please separate them with ";".
StreamingPropertyType.adaptiveInfo:
'MAX_RESOLUTION=3840X2160;MAX_FRAMERATE=60;UPDATE_SAME_LANGUAGE_CODE=1',
'MAX_RESOLUTION=3840X2160;MAX_FRAMERATE=60;UPDATE_SAME_LANGUAGE_CODE=1;OPEN_SUBTITLE_STYLE=TRUE',

/// update token [before] dash-player prepare done.
StreamingPropertyType.dashToken: 'YWJyVHlwZT1CUi1BVkMtREFTSC',
Expand Down Expand Up @@ -184,6 +186,8 @@ class _DashRomoteVideoState extends State<_DashRomoteVideo> {

@override
Widget build(BuildContext context) {
const TextStyle customTextStyle =
TextStyle(fontSize: 30, color: Colors.green);
return SingleChildScrollView(
child: Column(
children: <Widget>[
Expand All @@ -197,7 +201,9 @@ class _DashRomoteVideoState extends State<_DashRomoteVideo> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(
captions: _controller.value.captions,
customTextStyle: customTextStyle),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand Down Expand Up @@ -257,7 +263,7 @@ class _Mp4RemoteVideoState extends State<_Mp4RemoteVideo> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand Down Expand Up @@ -329,7 +335,7 @@ class _DrmRemoteVideoState extends State<_DrmRemoteVideo> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand Down Expand Up @@ -395,7 +401,7 @@ class _DrmRemoteVideoState2 extends State<_DrmRemoteVideo2> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand Down Expand Up @@ -456,7 +462,7 @@ class _TrackTestState extends State<_TrackTest> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand Down Expand Up @@ -518,7 +524,7 @@ class _AssetVideoState extends State<_AssetVideo> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand Down Expand Up @@ -828,7 +834,7 @@ class _LiveRomoteVideoState extends State<_LiveRemoteVideo> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand Down Expand Up @@ -907,7 +913,68 @@ class _TestRemoteVideoState extends State<_TestRemoteVideo> {
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
),
),
),
],
),
);
}
}

class _PictureCaptionVideo extends StatefulWidget {
@override
State<_PictureCaptionVideo> createState() => _PictureCaptionVideoState();
}

class _PictureCaptionVideoState extends State<_PictureCaptionVideo> {
late VideoPlayerController _controller;

@override
void initState() {
super.initState();
_controller = VideoPlayerController.network(
'https://livesim2.dashif.org/vod/testpic_2s/imsc1_img.mpd',
formatHint: VideoFormat.dash,
);

_controller.addListener(() {
if (_controller.value.hasError) {
print(_controller.value.errorDescription);
}
setState(() {});
});
_controller.setLooping(true);
_controller.initialize().then((_) => setState(() {}));
_controller.play();
}

@override
void dispose() {
_controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: <Widget>[
Container(padding: const EdgeInsets.only(top: 20.0)),
const Text('Picture Caption Test'),
Container(
padding: const EdgeInsets.all(20),
child: AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(captions: _controller.value.captions),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
Expand Down
Loading