File tree 6 files changed +28
-7
lines changed
packages/video_player/video_player_avfoundation 6 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 1
- ## NEXT
1
+ ## 2.2.18
2
2
3
+ * Wait to initialize m3u8 videos until size is set, fixing aspect ratio.
3
4
* Adjusts test timeouts for network-dependent native tests to avoid flake.
4
5
5
6
## 2.2.17
Original file line number Diff line number Diff line change 3
3
archiveVersion = 1;
4
4
classes = {
5
5
};
6
- objectVersion = 50 ;
6
+ objectVersion = 46 ;
7
7
objects = {
8
8
9
9
/* Begin PBXBuildFile section */
269
269
97C146E61CF9000F007C117D /* Project object */ = {
270
270
isa = PBXProject;
271
271
attributes = {
272
- LastUpgradeCheck = 1300 ;
272
+ LastUpgradeCheck = 1320 ;
273
273
ORGANIZATIONNAME = "The Flutter Authors";
274
274
TargetAttributes = {
275
275
97C146ED1CF9000F007C117D = {
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<Scheme
3
- LastUpgradeVersion = " 1300 "
3
+ LastUpgradeVersion = " 1320 "
4
4
version = " 1.3" >
5
5
<BuildAction
6
6
parallelizeBuildables = " YES"
Original file line number Diff line number Diff line change @@ -103,6 +103,22 @@ - (void)testAudioControls {
103
103
XCTAssertEqualWithAccuracy ([audioInitialization[@" duration" ] intValue ], 5400 , 200 );
104
104
}
105
105
106
+ - (void )testHLSControls {
107
+ NSObject <FlutterPluginRegistry> *registry =
108
+ (NSObject <FlutterPluginRegistry> *)[[UIApplication sharedApplication ] delegate ];
109
+ NSObject <FlutterPluginRegistrar> *registrar = [registry registrarForPlugin: @" TestHLSControls" ];
110
+
111
+ FLTVideoPlayerPlugin *videoPlayerPlugin =
112
+ (FLTVideoPlayerPlugin *)[[FLTVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
113
+
114
+ NSDictionary <NSString *, id > *videoInitialization =
115
+ [self testPlugin: videoPlayerPlugin
116
+ uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8" ];
117
+ XCTAssertEqualObjects (videoInitialization[@" height" ], @720 );
118
+ XCTAssertEqualObjects (videoInitialization[@" width" ], @1280 );
119
+ XCTAssertEqualWithAccuracy ([videoInitialization[@" duration" ] intValue ], 4000 , 200 );
120
+ }
121
+
106
122
- (NSDictionary <NSString *, id> *)testPlugin : (FLTVideoPlayerPlugin *)videoPlayerPlugin
107
123
uri : (NSString *)uri {
108
124
FlutterError *error;
Original file line number Diff line number Diff line change @@ -354,9 +354,13 @@ - (void)setupEventSinkIfReadyToPlay {
354
354
}
355
355
356
356
BOOL hasVideoTracks = [asset tracksWithMediaType: AVMediaTypeVideo].count != 0 ;
357
+ BOOL hasNoTracks = asset.tracks .count == 0 ;
357
358
358
- // The player has not yet initialized when it contains video tracks.
359
- if (hasVideoTracks && height == CGSizeZero .height && width == CGSizeZero .width ) {
359
+ // The player has not yet initialized when it has no size, unless it is an audio-only track.
360
+ // HLS m3u8 video files never load any tracks, and are also not yet initialized until they have
361
+ // a size.
362
+ if ((hasVideoTracks || hasNoTracks) && height == CGSizeZero .height &&
363
+ width == CGSizeZero .width ) {
360
364
return ;
361
365
}
362
366
// The player may be initialized but still needs to determine the duration.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: video_player_avfoundation
2
2
description : iOS implementation of the video_player plugin.
3
3
repository : https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_avfoundation
4
4
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
5
- version : 2.2.17
5
+ version : 2.2.18
6
6
7
7
environment :
8
8
sdk : " >=2.14.0 <3.0.0"
You can’t perform that action at this time.
0 commit comments