Error changing Windows Media Player component fullscreen property

1

I'm testing Windows Media player component in C#. At runtime my project receives the error :
"System.Runtime.InteropServices.COMException: 'Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))'" when changing fullscreen property!!!
The related code line:
axWindowsMediaPlayer1.fullScreen = true;
What's the reason???
I didn't find any useful matter on Google...

c#
windows-media-player

1 Answer

1

Finally I myself solved the problem: the embedded WMP control CAN BE maximized IF it's playing,so the following code MUST be used:

        if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsPlaying)
            axWindowsMediaPlayer1.fullScreen = true;  

Now the catastrophic error has gone:)

answered on Stack Overflow Jul 25, 2018 by Hamid Reza Ebrahimi

User contributions licensed under CC BY-SA 3.0