Another newbie question, please.
I've downloaded AVCodec video so I can use PlayVideo() in my script. However if it's the last command, the script finishes and video closes after 1-2 seconds. How can I tell Hollywood to wait till the video is finished? I don't want to use WaitLeftMouse command.
One more thing, please. How can I compile a complete standalone executable so it includes the codec and the video too?
Thank you in advance.
Wait till video is finished?
Re: Wait till video is finished?
I think I figured it out. It works but can anyone confirm it's the right method?
playing = IsVideoPlaying(1)
While playing = True
playing = IsVideoPlaying(1)
Wend
End
playing = IsVideoPlaying(1)
While playing = True
playing = IsVideoPlaying(1)
Wend
End
Re: Wait till video is finished?
Havent played with videos, but at least your idea seems right.
Regarding adding plugins to exe, you just need to link them to your exe.
Dont recall it from memory, but i think it is putting at beginning of your code something like this:
Regarding adding plugins to exe, you just need to link them to your exe.
Dont recall it from memory, but i think it is putting at beginning of your code something like this:
Code: Select all
@INCLUDE "pluginname.plg"
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Wait till video is finished?
@Bugala:
@INCLUDE is used for scripts, not for plugins.
@Jan:
You can do it like this:
Note that I have added a VWait() here. Otherwise your loop will be polling the video state as many times as the CPU allows, which is very bad. There should be some throttle to prevent wasting CPU cycles. VWait() is a convenient solution, you could of course also use a timer.
@INCLUDE is used for scripts, not for plugins.
@Jan:
You can do it like this:
Code: Select all
@REQUIRE "avcodec", {Link = True}
@VIDEO 1, "test.mpg"
PlayVideo(1)
playing = IsVideoPlaying(1)
While playing = True
playing = IsVideoPlaying(1)
VWait
Wend
Re: Wait till video is finished?
Thank you for your replies and advices. I did not think about the CPU cycles. Great forum!