Problem with windows media player RRS feed

  • Question

  • i have a main form with a button named (Open videos), when clicked
    a second form (form2) will open like this:

    form2 has a combobox which has a list of videos
    if any item of this combobox is selected, a video start playing
    also full screen mode is working fine
    but when form2 become (child form) to form1
    video isn't scaled right also full screen mode doesn't work like this:

    this is the code of form1 to make it parent:

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Form2.StartPosition = FormStartPosition.Manual
        Form2.Left = 105
        Form2.Top = 50
        Form2.MdiParent = Me
    End Sub

    and this is code of form2 to play videos:

    Public Class Form2
        Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
            If ComboBox1.SelectedItem = "Video 1" Then
                On Error Resume Next
                IO.File.WriteAllBytes(IO.Path.GetTempPath & "\Video 1.mp4", My.Resources.Video_2)
                AxWindowsMediaPlayer1.URL = IO.Path.GetTempPath & "\Video 1.mp4"
                IO.File.Delete(IO.Path.GetTempPath & "\Video 1.mp4")
            End If
            If ComboBox1.SelectedItem = "Video 2" Then
                On Error Resume Next
                IO.File.WriteAllBytes(IO.Path.GetTempPath & "\Video 2.mp4", My.Resources.Video_2)
                AxWindowsMediaPlayer1.URL = IO.Path.GetTempPath & "\Video 2.mp4"
                IO.File.Delete(IO.Path.GetTempPath & "\Video 2.mp4")
            End If
            If ComboBox1.SelectedItem = "Video 3" Then
                On Error Resume Next
                IO.File.WriteAllBytes(IO.Path.GetTempPath & "\Video 3.mp4", My.Resources.Video_3)
                AxWindowsMediaPlayer1.URL = IO.Path.GetTempPath & "\Video 3.mp4"
                IO.File.Delete(IO.Path.GetTempPath & "\Video 3.mp4")
            End If
        End Sub
    End Class

    tried a different code with no success:

    If ComboBox1.SelectedItem = "Video 1" Then
                Dim b As Byte() = My.Resources.Video_1
                Dim TheFIlePath As String = "Video 1.mp4"
                Dim TempFile As IO.FileStream = IO.File.Create(TheFIlePath)
                TempFile.Write(b, 0, b.Length)
                AxWindowsMediaPlayer1.URL = (TheFIlePath)
            End If
    Tuesday, April 28, 2020 7:59 PM

All replies

  • Hi Doctor GME,

    Thank you for posting here.

    I make a test based on your code, and reproduce your problem.

    It seems that windows media player cannot be played full screen in mdi child form.

    In order to help you resolve this issue, I suggest you report a problem in developer community.

    Best Regards,

    Xingyu Zhao

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 29, 2020 2:45 AM
  • thanks for reply
    i'll try to report the problem there
    Friday, May 1, 2020 8:10 PM