Error message Windows media player 10 or higher required for media element in WPF

Nam Nguyen 0 Reputation points
2024-07-11T03:04:05.8466667+00:00

When trying to use the media element in WPF to play an MP3 file, nothing happens when running the project. An error message says that Windows Media Player version 10 or higher is required, but Windows Media Player version 11 is already installed on the device. Reinstalling the media player did not resolve the issue. How can I fix this error?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-07-11T07:41:25.25+00:00

    Hi,@Nam Nguyen. Welcome to Microsoft Q&A. 

    According to the test, the WPF program can successfully play the English MP3 using the following code.

     

    
    <Grid>
    
        <MediaElement x:Name="mediaElement1" Width="400" Height="200" ></MediaElement>
    
    </Grid>
    
    

     

    
    public partial class MainWindow : Window
    
    {
    
        public MainWindow()
    
        {
    
            InitializeComponent();
    
            mediaElement1.LoadedBehavior = MediaState.Manual;
    
            mediaElement1.Source = new Uri(@"Your mp3 file address", UriKind.RelativeOrAbsolute);
    
            mediaElement1.Play();
    
        }
    
    }
    
    

     

    The prerequisite for its successful operation is that the Window system can successfully play mp3 files. You should check whether your Window system can play mp3 files correctly.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Kevin Kuang 0 Reputation points
    2025-03-05T02:18:12.52+00:00

    The same error will occur when using the MediaPlayer with the following code:

    MediaPlayer mediaPlayer = new();

    mediaPlayer.MediaFailed += MediaPlayer_MediaFailed;

    mediaPlayer.Open(MusicUri);

    mediaPlayer.Play(); // failed with error "windows media player version 10 or later is required"

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.