msdxm.ocx - Windows Media Player Help...

I am using Windows Media Player (msdxm.ocx) in Visual Basic. I have this:

MediaPlayer1.Open ("C:/movie1.mpeg")
MediaPlayer1.DisplaySize = mpFullScreen
MediaPlayer1.Open ("C:/movie2.mpeg")

I want VB to play the first in fullscreen and then when it is done (without going to windowed mode) play the next. How can I do this? Code would help.
Who is Participating?
I think that MediaPlayer automatically resets to windowed mode if a stream has ended. You could use the following:

Dim CountMovies As Integer

Private Sub Form_Load()
  MediaPlayer1.Open ("C:\movie1.mpeg")
  MediaPlayer1.DisplaySize = mpFullScreen
End Sub

Private Sub MediaPlayer1_EndOfStream(ByVal Result As Long)
  CountMovies = CountMovies + 1
  Select Case CountMovies
    Case 1
      MediaPlayer1.Open ("C:\movie2.mpeg")
    Case 2
      MediaPlayer1.Open ("C:\movie3.mpeg")
    Case 3
      MediaPlayer1.Open ("C:\movie4.mpeg")
    Case 4
  End Select
End Sub

But depending on the system you are using, you might see MediaPlayer switch back to Normal Size and then automatically to Fullscreen again.

Just an idea....give it a try...:o)

try creating a playlist of the movies you want to play then mediaplayer should stay in fullscreen mode

LinkyAuthor Commented:
Well thats good, but I want the program must to do it, regardless of the person's computer.
LinkyAuthor Commented:
Thanks a lot, it went back to window mode, but it does not matter. I just wanted code to play the next media file.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.