-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[video_player] added iOS exception on incorrect asset path #4318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[video_player] added iOS exception on incorrect asset path #4318
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
d797b43
to
69fef98
Compare
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.
Can you add some description with the exception logs before and after your change.
playerFactory:_playerFactory]; | ||
return [self onPlayerSetup:player frameUpdater:frameUpdater]; | ||
} | ||
@catch (NSException *exception) { |
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.
did it crash before when the exception is thrown?
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.
for ios yes. using the code sample of flutter/flutter#118660 (comment), it should crash and look like this

69fef98
to
330b347
Compare
current exception logs when asset path is incorrect
|
the proposed try catch update will now raise a platformException, and will not instantly crash the app
|
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.
looks like a good change. can you add some tests?
997fa36
to
2d1162b
Compare
packages/video_player/video_player_avfoundation/test/avfoundation_video_player_test.dart
Show resolved
Hide resolved
2d1162b
to
ebcf0e3
Compare
try { | ||
await player.create(DataSource( | ||
sourceType: DataSourceType.asset, | ||
asset: 'incorrectAsset', |
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.
nit: can you make it look more like a path, e.g. /path/to/incorrect_asset
2a306b5
to
4ecf1df
Compare
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.
You'll need to run the format command dart pub global run flutter_plugin_tools format --packages video_player
before this can land.
4ecf1df
to
e632d70
Compare
finished running the format command |
9420170
to
7840012
Compare
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 one small change.
packages/video_player/video_player_avfoundation/test/avfoundation_video_player_test.dart
Outdated
Show resolved
Hide resolved
7840012
to
9e77817
Compare
flutter/packages@aa1eace...369ee7e 2023-07-14 [email protected] [Tool] New tool to download android dependencies (flutter/packages#4408) 2023-07-14 [email protected] [video_player] added iOS exception on incorrect asset path (flutter/packages#4318) 2023-07-14 [email protected] [google_maps_flutter_platform_interface] Add support for cloud-based map styling (flutter/packages#4141) 2023-07-14 [email protected] [webview_flutter] Adds support for receiving a url with WebResourceError (flutter/packages#3884) 2023-07-14 [email protected] [xdg_directories] Remove `process` dependency (flutter/packages#4460) 2023-07-13 [email protected] [various] Update Pigeon in Swift plugins (flutter/packages#4461) 2023-07-13 [email protected] Roll Flutter from 544d30d to c40173f (10 revisions) (flutter/packages#4457) 2023-07-13 [email protected] Roll Flutter (stable) from 796c8ef to f468f33 (2 revisions) (flutter/packages#4456) 2023-07-13 [email protected] Fix Router Config Issues #4300 (go_router_builder/example) (flutter/packages#4369) 2023-07-13 [email protected] [webview_flutter_platform_interface] Adds url to `WebResourceError` (flutter/packages#4439) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@aa1eace...369ee7e 2023-07-14 [email protected] [Tool] New tool to download android dependencies (flutter/packages#4408) 2023-07-14 [email protected] [video_player] added iOS exception on incorrect asset path (flutter/packages#4318) 2023-07-14 [email protected] [google_maps_flutter_platform_interface] Add support for cloud-based map styling (flutter/packages#4141) 2023-07-14 [email protected] [webview_flutter] Adds support for receiving a url with WebResourceError (flutter/packages#3884) 2023-07-14 [email protected] [xdg_directories] Remove `process` dependency (flutter/packages#4460) 2023-07-13 [email protected] [various] Update Pigeon in Swift plugins (flutter/packages#4461) 2023-07-13 [email protected] Roll Flutter from 544d30d to c40173f (10 revisions) (flutter/packages#4457) 2023-07-13 [email protected] Roll Flutter (stable) from 796c8ef to f468f33 (2 revisions) (flutter/packages#4456) 2023-07-13 [email protected] Fix Router Config Issues flutter#4300 (go_router_builder/example) (flutter/packages#4369) 2023-07-13 [email protected] [webview_flutter_platform_interface] Adds url to `WebResourceError` (flutter/packages#4439) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
surfaced the incorrect asset path error to dart using try catch.
Fixes #118660
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.