This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree 4 files changed +32
-6
lines changed
packages/video_player/video_player
4 files changed +32
-6
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.1.8
2
+
3
+ * Refactor ` FLTCMTimeToMillis ` to support indefinite streams. Fixes [ #48670 ] ( https://github.com/flutter/flutter/issues/48670 ) .
4
+
1
5
## 2.1.7
2
6
3
7
* Update exoplayer to 2.14.1, removing dependency on Bintray.
Original file line number Diff line number Diff line change @@ -77,6 +77,23 @@ void main() {
77
77
skip: ! (kIsWeb || defaultTargetPlatform == TargetPlatform .android),
78
78
);
79
79
80
+ testWidgets (
81
+ 'live stream duration != 0' ,
82
+ (WidgetTester tester) async {
83
+ VideoPlayerController networkController = VideoPlayerController .network (
84
+ 'https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8' ,
85
+ );
86
+ await networkController.initialize ();
87
+
88
+ expect (networkController.value.isInitialized, true );
89
+ // Live streams should have either a positive duration or C.TIME_UNSET if the duration is unknown
90
+ // See https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/Player.html#getDuration--
91
+ expect (networkController.value.duration,
92
+ (Duration duration) => duration != Duration .zero);
93
+ },
94
+ skip: (kIsWeb),
95
+ );
96
+
80
97
testWidgets (
81
98
'can be played' ,
82
99
(WidgetTester tester) async {
Original file line number Diff line number Diff line change 11
11
#error Code Requires ARC.
12
12
#endif
13
13
14
- int64_t FLTCMTimeToMillis (CMTime time) {
15
- if (time .timescale == 0 ) return 0 ;
16
- return time .value * 1000 / time .timescale ;
17
- }
18
-
19
14
@interface FLTFrameUpdater : NSObject
20
15
@property (nonatomic ) int64_t textureId;
21
16
@property (nonatomic , weak , readonly ) NSObject <FlutterTextureRegistry>* registry;
@@ -107,6 +102,16 @@ - (void)itemDidPlayToEndTime:(NSNotification*)notification {
107
102
}
108
103
}
109
104
105
+ const int64_t TIME_UNSET = -9223372036854775807 ;
106
+
107
+ static inline int64_t FLTCMTimeToMillis (CMTime time) {
108
+ // When CMTIME_IS_INDEFINITE return a value that matches TIME_UNSET from ExoPlayer2 on Android.
109
+ // Fixes https://github.com/flutter/flutter/issues/48670
110
+ if (CMTIME_IS_INDEFINITE (time )) return TIME_UNSET;
111
+ if (time .timescale == 0 ) return 0 ;
112
+ return time .value * 1000 / time .timescale ;
113
+ }
114
+
110
115
static inline CGFloat radiansToDegrees (CGFloat radians) {
111
116
// Input range [-pi, pi] or [-180, 180]
112
117
CGFloat degrees = GLKMathRadiansToDegrees ((float )radians);
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter
3
3
widgets on Android, iOS, and web.
4
4
repository : https://github.com/flutter/plugins/tree/master/packages/video_player/video_player
5
5
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
6
- version : 2.1.7
6
+ version : 2.1.8
7
7
8
8
environment :
9
9
sdk : " >=2.12.0 <3.0.0"
You can’t perform that action at this time.
0 commit comments