Skip to content
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

Fix Media Element fails to load a URL #2265

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
39c45c0
Enhance Dispose method for better resource management
ne0rrmatrix Oct 7, 2024
7d048f9
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Oct 15, 2024
18bcae7
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Oct 15, 2024
e24c257
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Oct 16, 2024
7242638
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Oct 20, 2024
6bfb6cf
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Oct 31, 2024
ea9bea5
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Nov 5, 2024
c10f0f4
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Nov 7, 2024
7094c9b
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Nov 11, 2024
e642112
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Nov 11, 2024
32d63cb
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Dec 2, 2024
050961b
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
brminnick Dec 18, 2024
3a1f784
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Dec 19, 2024
fef73b5
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Dec 20, 2024
58e31a1
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Dec 28, 2024
94e6560
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Jan 3, 2025
f4a454f
Merge branch 'main' into FixWindowsMediaSourceDisposalBug
ne0rrmatrix Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@ protected virtual void Dispose(bool disposing)

if (disposing)
{
mediaPlayerElement.MediaPlayer.Pause();

if(mediaPlayerElement.MediaPlayer.Source is Windows.Media.Core.MediaSource mediaSource)
{
// Dispose the MediaSource to release the resources
// https://learn.microsoft.com/en-us/windows/uwp/audio-video-camera/play-audio-and-video-with-mediaplayer Shows how to dispose the MediaSource
mediaSource.Dispose();
}
mediaPlayerElement.MediaPlayer.Source = null;
mediaPlayerElement.MediaPlayer.Dispose();
mediaPlayerElement.SetMediaPlayer(null);
}

isDisposed = true;
Expand Down