dotnet / dotnet/wpf

`MediaPlayer` doesn't work if legacy WMP is not installed.

Open
#10,366 2 comments 0 reactions 0 assignees View on GitHub
Enhancement Requested
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

In modern versions of Windows, Windows Media Player is a legacy item one has to add via Optional Features. If you don't do this, then the `MediaPlayer` and `VideoDrawing` in WPF apps doesn't work.

This error is shown if the legacy player is not installed:
`System.Runtime.InteropServices.COMException (0x88980507): MILAVERR_INVALIDWMPVERSION (0x88980507)`

It would be great to be able to play videos within WPF regardless of if the end-user has an optional feature installed of not.

### Reproduction Steps

1. Install a fresh install of Windows 11 Or Go to "Manage Optional Features" and remove the "Windows Media Player Legacy" from your system (might need to reboot for it to actually go away)
2. Try to use a WPF app that uses a `MediaPlayer` and `VideoDrawing` to playback a video.

### Expected behavior

1. WPF would provide a working `MediaPlayer` that doesn't rely on something labeled 'Legacy' to be installed.

### Actual behavior

1. WPF does not provide a working `MediaPlayer`

### Regression?

_No response_

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

.net 8
Windows 10 or 11
x64

Does not appear to be affected by this configuration.

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.