-
Notifications
You must be signed in to change notification settings - Fork 837
fix(iOS): FileOpenPicker not returning video files #22428
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR fixes a bug where the FileOpenPicker on iOS was not returning video files when selected by the user. The issue occurred because the implementation only checked for image URLs in the picker results, causing video selections to return null.
Changes:
- Enhanced PHPickerFilter configuration to support both images and videos based on FileTypeFilter
- Updated FinishedPickingMedia method to check for video URLs before falling back to image URLs
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| PHPickerFilter? pickerFilter = null; | ||
| if (hasImages && hasVideos) | ||
| { | ||
| // Support both images and videos | ||
| pickerFilter = PHPickerFilter.GetAnyFilterMatchingSubfilters([ | ||
| PHPickerFilter.ImagesFilter, PHPickerFilter.VideosFilter | ||
| ]); | ||
| } | ||
| else if (hasImages) | ||
| { | ||
| pickerFilter = PHPickerFilter.ImagesFilter; | ||
| } | ||
| else if (hasVideos) | ||
| { | ||
| pickerFilter = PHPickerFilter.VideosFilter; | ||
| } | ||
|
|
||
| var imageConfiguration = new PHPickerConfiguration | ||
| { | ||
| Filter = PHPickerFilter.ImagesFilter, | ||
| SelectionLimit = limit | ||
| Filter = pickerFilter, SelectionLimit = limit | ||
| }; |
Copilot
AI
Jan 21, 2026
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.
When neither hasImages nor hasVideos is true (e.g., FileTypeFilter contains only document extensions like .pdf), pickerFilter will be null. According to Apple's documentation, a null filter in PHPickerConfiguration means no filtering is applied, allowing all media types. This could lead to unexpected behavior when SuggestedStartLocation is PicturesLibrary but FileTypeFilter specifies non-media file types. Consider falling through to the default case (document picker) when pickerFilter is null, or documenting this edge case behavior.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22428/wasm-skia-net9/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22428/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22428/docs/index.html |
|
The build 192403 found UI Test snapshots differences: Details
|
|
The build 192403 found UI Test snapshots differences: Details
|
|
|
|
The build 192403 found UI Test snapshots differences: Details
|
GitHub Issue: closes https://github.com/unoplatform/ziidms-private/issues/106
Previously only checked for image URLs, causing video selections to return null.
PR Type:
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️