Skip to content

Commit f199533

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 528c6f5 + e4834fe commit f199533

File tree

112 files changed

+1589
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1589
-135
lines changed

packages/video_player_avplay/CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
## 0.5.21
2+
3+
* Upgrade native player.
4+
1.[PLAYER]Add definitions of the subtitle attributes.
5+
2.[PLAYER]Receive and pass subtitle attributes of streaming to video player in subtitle callback.
6+
* Handle the subtitle attributes which include type, startTime, stopTime and value.
7+
* Pass subtitle attributes to VideoPlayerController.
8+
9+
## 0.5.20
10+
11+
* Add suspend and restore interface.
12+
13+
## 0.5.19
14+
15+
* Upgrade native player
16+
1.[HLS]Fix crash issue when rotation from portrait to landscape or vice-versa.
17+
2.[HSL]Multiview scenario stability improvement.
18+
3.[PLAYER]Modified code for correct information update in status_monitor in case of tracksource prepare is failed.
19+
4.[HLS]IAMF codec support in HLS.
20+
5.[HLS]Time for curl perfrom increased so that perform should get complete and after that curl unit it resettting.
21+
6.[HLS]Exposed new api to pre load ini file without player object.
22+
7.[HLS]Trim Whitespaces from URL in ChangeSource.
23+
8.[HLS]Removed a previous warning format ‘%s’ expects argument of type ‘char*’.
24+
9.[HLS]Shrink log length to fit in vlog dump.
25+
10.[HLS]Removed repetitive call for fetching segment.
26+
11.[DASH]Change dash timeline case live duration calculation scheme.
27+
12.[DASH]Dash low latency stability improvement.
28+
13.[DASH]Fix no subtitle callback issue.
29+
130
## 0.5.18
231

332
* Add getActiveTrackInfo interface.

packages/video_player_avplay/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To use this package, add `video_player_avplay` as a dependency in your `pubspec.
1212

1313
```yaml
1414
dependencies:
15-
video_player_avplay: ^0.5.18
15+
video_player_avplay: ^0.5.21
1616
```
1717
1818
Then you can import `video_player_avplay` in your Dart code:

packages/video_player_avplay/example/lib/main.dart

Lines changed: 144 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class _App extends StatelessWidget {
2222
@override
2323
Widget build(BuildContext context) {
2424
return DefaultTabController(
25-
length: 7,
25+
length: 9,
2626
child: Scaffold(
2727
key: const ValueKey<String>('home_page'),
2828
appBar: AppBar(
@@ -37,6 +37,8 @@ class _App extends StatelessWidget {
3737
Tab(icon: Icon(Icons.cloud), text: 'DRM PlayReady'),
3838
Tab(icon: Icon(Icons.cloud), text: 'Track'),
3939
Tab(icon: Icon(Icons.cloud), text: 'Asset'),
40+
Tab(icon: Icon(Icons.live_tv), text: 'Live'),
41+
Tab(icon: Icon(Icons.local_florist), text: 'ChangeURLTest'),
4042
],
4143
),
4244
),
@@ -49,6 +51,8 @@ class _App extends StatelessWidget {
4951
_DrmRemoteVideo2(),
5052
_TrackTest(),
5153
_AssetVideo(),
54+
_LiveRemoteVideo(),
55+
_TestRemoteVideo(),
5256
],
5357
),
5458
),
@@ -748,3 +752,142 @@ class _GetTextTrackButton extends StatelessWidget {
748752
);
749753
}
750754
}
755+
756+
class _LiveRemoteVideo extends StatefulWidget {
757+
@override
758+
State<_LiveRemoteVideo> createState() => _LiveRomoteVideoState();
759+
}
760+
761+
class _LiveRomoteVideoState extends State<_LiveRemoteVideo> {
762+
late VideoPlayerController _controller;
763+
764+
@override
765+
void initState() {
766+
super.initState();
767+
_controller = VideoPlayerController.network(
768+
'https://hlive.ktv.go.kr/live/klive_h.stream/playlist.m3u8',
769+
);
770+
771+
_controller.addListener(() {
772+
if (_controller.value.hasError) {
773+
print(_controller.value.errorDescription);
774+
}
775+
setState(() {});
776+
});
777+
_controller.setLooping(true);
778+
_controller.initialize().then((_) => setState(() {}));
779+
_controller.play();
780+
}
781+
782+
@override
783+
void dispose() {
784+
_controller.dispose();
785+
super.dispose();
786+
}
787+
788+
@override
789+
Widget build(BuildContext context) {
790+
return SingleChildScrollView(
791+
child: Column(
792+
children: <Widget>[
793+
Container(padding: const EdgeInsets.only(top: 20.0)),
794+
const Text('Playing Live TV'),
795+
Container(
796+
padding: const EdgeInsets.all(20),
797+
child: AspectRatio(
798+
aspectRatio: _controller.value.aspectRatio,
799+
child: Stack(
800+
alignment: Alignment.bottomCenter,
801+
children: <Widget>[
802+
VideoPlayer(_controller),
803+
ClosedCaption(text: _controller.value.caption.text),
804+
_ControlsOverlay(controller: _controller),
805+
VideoProgressIndicator(_controller, allowScrubbing: true),
806+
],
807+
),
808+
),
809+
),
810+
],
811+
),
812+
);
813+
}
814+
}
815+
816+
class _TestRemoteVideo extends StatefulWidget {
817+
@override
818+
State<_TestRemoteVideo> createState() => _TestRemoteVideoState();
819+
}
820+
821+
class _TestRemoteVideoState extends State<_TestRemoteVideo> {
822+
late VideoPlayerController _controller;
823+
824+
@override
825+
void initState() {
826+
super.initState();
827+
_controller = VideoPlayerController.network(
828+
'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
829+
);
830+
831+
_controller.addListener(() {
832+
if (_controller.value.hasError) {
833+
print(_controller.value.errorDescription);
834+
}
835+
setState(() {});
836+
});
837+
_controller.setLooping(true);
838+
_controller.initialize().then((_) => setState(() {}));
839+
_controller.play();
840+
_controller.setRestoreData(
841+
restoreDataSource: restoreDataSource,
842+
resumeTime: restoreTime,
843+
);
844+
}
845+
846+
@override
847+
void dispose() {
848+
_controller.dispose();
849+
super.dispose();
850+
}
851+
852+
DataSource restoreDataSource() {
853+
final DataSource dataSource = DataSource(
854+
sourceType: DataSourceType.network,
855+
uri: 'https://media.w3.org/2010/05/bunny/trailer.mp4',
856+
);
857+
return dataSource;
858+
}
859+
860+
int restoreTime() {
861+
/// if resumeTime >= 0 , it will restore from resumeTime
862+
/// if resumeTime is not set or <0, it will restore from the time when suspend is called
863+
const int resumeTime = 0;
864+
return resumeTime;
865+
}
866+
867+
@override
868+
Widget build(BuildContext context) {
869+
return SingleChildScrollView(
870+
child: Column(
871+
children: <Widget>[
872+
Container(padding: const EdgeInsets.only(top: 20.0)),
873+
const Text('ChangeURLTest'),
874+
Container(
875+
padding: const EdgeInsets.all(20),
876+
child: AspectRatio(
877+
aspectRatio: _controller.value.aspectRatio,
878+
child: Stack(
879+
alignment: Alignment.bottomCenter,
880+
children: <Widget>[
881+
VideoPlayer(_controller),
882+
ClosedCaption(text: _controller.value.caption.text),
883+
_ControlsOverlay(controller: _controller),
884+
VideoProgressIndicator(_controller, allowScrubbing: true),
885+
],
886+
),
887+
),
888+
),
889+
],
890+
),
891+
);
892+
}
893+
}

0 commit comments

Comments
 (0)