-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[video_player] Wait to initialize m3u8 videos on iOS until size is set #4727
Conversation
@@ -3,7 +3,7 @@ | |||
archiveVersion = 1; | |||
classes = { | |||
}; | |||
objectVersion = 50; | |||
objectVersion = 46; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let Xcode touch the project.
@@ -2,7 +2,7 @@ name: video_player_avfoundation | |||
description: iOS implementation of the video_player plugin. | |||
repository: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_avfoundation | |||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 | |||
version: 2.2.17 | |||
version: 2.2.18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stuartmorgan is there anything else I need to do to version this federated plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't push version changes through to the app-facing plugin; the expectation is that people are updating transitive dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a CHANGELOG nit
|
||
* Wait to initialize m3u8 videos until size is set, fixing aspect ratio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Wait to initialize m3u8 videos until size is set, fixing aspect ratio | |
* Wait to initialize m3u8 videos until size is set, fixing aspect ratio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// The player has not yet initialized when it contains video tracks. | ||
if (hasVideoTracks && height == CGSizeZero.height && width == CGSizeZero.width) { | ||
// The player has not yet initialized when it has no size, unless it is an audio-only track. | ||
// HLS m3u8 video files never load any tracks, and are also not yet initialized until they have a size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that any other formats would suffer from this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly, we have limited testing for the range of possible video types.
At least now it will be no different than before #4639 in terms of file formats that don't have tracks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with naming nit
@@ -103,6 +103,22 @@ - (void)testAudioControls { | |||
XCTAssertEqualWithAccuracy([audioInitialization[@"duration"] intValue], 5400, 200); | |||
} | |||
|
|||
- (void)testHlsControls { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testHLSControls
, since it's ObjC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -2,7 +2,7 @@ name: video_player_avfoundation | |||
description: iOS implementation of the video_player plugin. | |||
repository: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_avfoundation | |||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 | |||
version: 2.2.17 | |||
version: 2.2.18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't push version changes through to the app-facing plugin; the expectation is that people are updating transitive dependencies.
#4639 introduced playing audio-only files with
video_player
, detected with[asset tracksWithMediaType:AVMediaTypeVideo]
. Unfortunately HTTPS Live Streaming files (m3u8) are video files, but never load tracks. Allow initialization of "video" files with no tracks of any kind,AVMediaTypeVideo
or otherwise.Fixes flutter/flutter#97206
Test with flutter/assets-for-api-docs#178
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.