LoadMedia(1, "Video.mpg"), etc sounds very logical and quite a good idea to me PB.
Looking at this post got me to wondering if my recent unneeded reformat may have fixed up the little bug I had with the movie commands & playing music, so I gave it a quick try but alas, nope, moviestatus() still refuses to return 0 for me when a song finishes playing.
Try this bit of code for me & see if it runs properly for you.
Code: Select all
If OpenWindow(0,50,50,200,200,#PB_Window_SystemMenu|#PB_Window_TitleBar,"Test")
init=InitMovie()
If init
load=LoadMovie(0,"C:\Windows\Media\Windows XP Startup.wav")
;load=LoadMovie(0,"C:\Program Files\PureBasic\My Projects\GraphicsStuff\Media\V822.mp3")
If load
play=PlayMovie(0,WindowID())
Delay(100) ; give song a chance to start playing
EndIf
EndIf
Else
End
EndIf
Repeat
EventID=WindowEvent()
If EventID=0:Delay(1):Else:Delay(0):EndIf
status=MovieStatus() ; should return 0 when music stops, but not on my computer ?? (PB3.94 only )
Debug status ; used to work fine on PB3.93
If status=0
If play
stop=StopMovie()
EndIf
Debug "song has finished playing"
Quit=1
EndIf
If EventID=#PB_Event_CloseWindow
Quit=1
EndIf
Until Quit=1
FreeMovie(0)
End