Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8848121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:21:13+00:00 2026-06-14T12:21:13+00:00

I am having trouble getting videos to play using the WPF MediaElement on a

  • 0

I am having trouble getting videos to play using the WPF MediaElement on a windows 8 box. Since the MediaElement control relies on Windows Media Player, I tried to play the video on my Win 8 box in WMP and it plays fine, so it doesnt appear to be a codec problem. My current theory is it has something to do with WMP, rather than a change I need to make to the code. Any help would be greatly appreciated!

Here is a test app that I mocked up that also has the problem; it works just fine on windows 7 (loads a black screen that plays when you click it), but fails to do anything in win 8 (white screen with no interaction). I’ve tried several different methods of loading the video in before I concluded it probably didn’t matter how I did it, this code is just the last revision. If you want to see the issue yourself (actually, just knowing if its just my windows 8 machine would be very helpful), its a pretty small WPF app and any WMV should work.

C#:

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        bool opened = false;
        var mre = new ManualResetEvent(false);


        currentMediaElement.BeginInit();
        currentMediaElement.Source = new Uri("Video.wmv", UriKind.RelativeOrAbsolute);
        currentMediaElement.EndInit();
        currentMediaElement.LoadedBehavior = currentMediaElement.UnloadedBehavior = MediaState.Manual;
        currentMediaElement.MediaOpened += delegate
        {

            opened = true;
            mre.Set();
        };
        currentMediaElement.Stop();

        mre.WaitOne(5000);
    }

    private void currentMediaElement_MouseDown(object sender, MouseButtonEventArgs e)
    {
        currentMediaElement.Play();
    }
}

XAML:

<Window x:Class="TestApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
        <MediaElement Name="currentMediaElement" MouseDown="currentMediaElement_MouseDown"></MediaElement>
    </Grid>
</Window>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:21:15+00:00Added an answer on June 14, 2026 at 12:21 pm

    Turns out it was either the windows 8 image my company was using or the fact that they were using remote desktop connections to test. If you’re running into this issue I recommend trying to change the test environment!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having trouble getting my JTable that im using to display either check boxes
I'm having trouble getting Tire working using ElasticSearch with the Bonsai addon on the
I'm currently having trouble getting example code for using tweepy to access Twitter's Streaming
I'm having trouble getting Japanese text to display properly on a website compiled using
I'm having trouble getting the server to recognize a JSON POST request since I
I'm having trouble getting OpenGL 3.2 to run on Lion (osx 10.7.4) using Derelict3
Having trouble getting pyflakes to run on windows. On Windows there is no apt
im having trouble getting a popup using javascript to show table data onmouseover when
I am having trouble getting this code to run using Google Chrome(I have not
im having trouble getting a string (containing a URL) from one activity to another.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.