Skip to content

Conversation

@ne0rrmatrix
Copy link
Contributor

[Bug Fix]

Description of Change

This changes how Source is set in Windows for MediaPlayer. It currently sets source directly. Now it will set source not on Player but on Player.MediaPlayer using either SetFileSource or SetUriSource This addresses the issue linked below where an mp4 file in a Url will fail to playback after an arbitrary number of times it has been loaded.

Linked Issues

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

Previous behavior

2025-10-24.17-47-14.mp4

Fixed Behavior

2025-10-24.18-03-13.mp4

Copilot AI review requested due to automatic review settings October 25, 2025 01:17
Copy link
Contributor

Copilot AI left a 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 in the Windows implementation of MediaElement where MP4 files from URLs would fail to playback after being loaded multiple times. The fix changes how media sources are set by using the MediaPlayer API methods (SetUriSource and SetFileSource) instead of directly setting the Source property.

Key Changes:

  • Replace direct Player.Source assignment with Player.MediaPlayer.SetUriSource() for URI-based sources
  • Replace direct Player.Source assignment with Player.MediaPlayer.SetFileSource() for file-based sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Windows MediaElement Playbackback Bug

1 participant