Error changing Windows Media Player component fullscreen property


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...


1 Answer


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