locked
axwindowsmediaplayer RRS feed

  • Question

  • I tryed to make a media player and i added a button to the form called "Full Srceen".

    and typed the following code:

      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)handles Button1.Click

    AxWindowsMediaPlayer1.fullScreen = True

    End Sub 

    End Class


    'so i get an error message : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))


    help me please

     

    Tuesday, May 4, 2010 4:40 PM

Answers

  • The problem is that you cannot set the media player control to fullscreen when media player playingState is not playing. So try the code below to check if the playingstate is playing.

     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Then
                AxWindowsMediaPlayer1.fullScreen = True
            End If
          
        End Sub

     

    By the way, try to post readable text here next time.

    kaymaf


    CODE CONVERTER SITE

    http://www.carlosag.net/Tools/CodeTranslator/.

    http://www.developerfusion.com/tools/convert/csharp-to-vb/.

    • Marked as answer by NRA3088 Tuesday, May 4, 2010 5:06 PM
    Tuesday, May 4, 2010 5:03 PM

All replies

  • The problem is that you cannot set the media player control to fullscreen when media player playingState is not playing. So try the code below to check if the playingstate is playing.

     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Then
                AxWindowsMediaPlayer1.fullScreen = True
            End If
          
        End Sub

     

    By the way, try to post readable text here next time.

    kaymaf


    CODE CONVERTER SITE

    http://www.carlosag.net/Tools/CodeTranslator/.

    http://www.developerfusion.com/tools/convert/csharp-to-vb/.

    • Marked as answer by NRA3088 Tuesday, May 4, 2010 5:06 PM
    Tuesday, May 4, 2010 5:03 PM
  • Thanks that helps a lot Lol I’ll type better next time

    god bless

     

    Tuesday, May 4, 2010 5:09 PM