Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I created a Windows form application and added the Windows Media player COM component from the toolbox, under container sub section. Used C# and .net 4.0 framework, application built targeting x86 platform.

I have the below code on the media player load,
private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
        {
            OpenFileDialog opend = new OpenFileDialog();
            if (DialogResult.OK == opend.ShowDialog())
            {
                axWindowsMediaPlayer1.URL = opend.FileName;
                axWindowsMediaPlayer1.Ctlcontrols.play();
            }
        }

Tested using a sample WMV file.
The application when run on Win 7 (32 or 64 bit), plays the WMV file correctly.

However, when I run the same application on Win XP SP3 (32 bit) or Win XP, the play back of the video blackens out and the playback is broken and results in nothing being visible. When the playback is blackened, I observed that the CPU utilization of the machine spiked to 100%. However, when I play the same WMV file on the installed Windows media player(WMP version 11) it plays fine.

I don't know, If I am missing anything.

Any help is greatly appreciated.
Thanks.
Posted

1 solution

Change windows media player compatibility to SP1 , SP2 , Or SP3 Accordingly , or add this to your code :

VB
{
    Dim Process.Start as app
    Dim app.Compatibility(); e as c
    {
    app (axWindowsMediaPlayer1.Open();
    appId = (c)app (assignedId)
    app.app (c) == servicePack1 , servicePack2
    }

}
 
Share this answer
 
Comments
JamesHadleyChase 17-Jul-15 17:00pm    
Hi Inpec Coding. Foremost thank you for your response. I figured out that, On Win XP SP3, the video playback is improper(blackened) until I toggle the Hardware acceleration slider to "none" from "full" under Display properties-> Settings Tab -> Advanced button -> Troubleshoot tab.

Now, I can have a neat playback on Win XP only if the above setting is satiated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900