-
Notifications
You must be signed in to change notification settings - Fork 442
Fix Windows Media Source bug with Packaged Apps #2609
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
Open
ne0rrmatrix
wants to merge
15
commits into
CommunityToolkit:main
Choose a base branch
from
ne0rrmatrix:FixResourceMediaSource
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix Windows Media Source bug with Packaged Apps #2609
ne0rrmatrix
wants to merge
15
commits into
CommunityToolkit:main
from
ne0rrmatrix:FixResourceMediaSource
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…not work when running app as packaged.
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 on Windows where media playback fails in packaged mode by ensuring that the MediaElement correctly retrieves package resources.
- Added a null and whitespace check on ResourceMediaSource.Path before constructing the file path.
- Introduced two new helper classes (FileSystemUtils and AppInfoUtils) to retrieve and normalize the app package file path on Windows.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
MediaManager.windows.cs | Adds a Path check and uses PlatformGetFullAppPackageFilePath to correctly obtain a media file’s URI. |
FileSystemUtils.windows.cs | Introduces file path normalization and retrieval methods to support packaged app scenarios. |
AppInfoUtils.windows.cs | Implements app info utilities, including packaged app detection and version retrieval. |
2 tasks
VladislavAntonyuk
approved these changes
Jul 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
This fixes a bug in Windows where running an app in packaged mode results in media element not finding package resources and failing to playback Media Source from resource directory.
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
To test this change run sample app in packaged and unpackaged mode and load local resource from drop down menu in sample app. It fixes an issue where running app as packaged results in failed media playback when choosing local resource from menu.
I added two Microsoft internal classes and I used null forgiveness operator. I know that is not allowed and would love it if someone could tell me if I should just rewrite the internals or just do the minimum to have it compile. Currently I only made the adjustments to let the app compile. I am happy to fix the use of null operator but I wanted feedback before modifying MS internals.