Here's the problem: I'm using mciSendString to play an AVI video. How to loop / repeat a video forever with that API function?
Printable View
Here's the problem: I'm using mciSendString to play an AVI video. How to loop / repeat a video forever with that API function?
Gettickcount? Do you know the duration?
Take a look at the link in my signature. It is for looping an MIDI file, but the principle should still be the same for other media types since you're using mciSendString().
This is the code I’m using to play an avi video. I think it’s very much the same code they have here in vbworld.com.
I tried to get information on mciSendString() from MSDN and from the web, but didn’t get any understandable facts. I would appreciate it if someone could tell the actual code how to get this work (that means to loop an avi video).
Dim Ret As Long, A$, X As Integer, Y As Integer
X = 0
Y = 0
A$ = "C:\FileName.avi"
Ret = mciSendString("stop movie", 0&, 128, 0)
Ret = mciSendString("close movie", 0&, 128, 0)
Ret = mciSendString("open AVIvideo!" & A$ & " alias movie parent " & Form1.hwnd & " style child", 0&, 128, 0)
Ret = mciSendString("put movie window client at " & X & " " & Y & " 0 0", 0&, 128, 0)
Ret = mciSendString("play movie", 0&, 128, 0)
Ret = mciSendString("close all", 0&, 128, 0)
Did you look at the link in my signature? It will tell you how to loop something being played by MCI.
http://161.58.186.97/showthread.php?s=&threadid=95340