Link to home
Start Free TrialLog in
Avatar of Discomonkey
Discomonkey

asked on

Playing video at certain time

Hey experts!

I'm looking to make a install that will install a video and set it to play at a certain time.  I'm not sure if I should either write a program to play a video, or somehow set the scheduler for windows to play it.  In either case, I'm not sure where to begin.  So my question is: Do you experts have any ideas on how to do this?  thanks!

Avatar of mrwad99
mrwad99
Flag of United Kingdom of Great Britain and Northern Ireland image

It depends what you mean by 'install' the video.  I think you mean just copy it to the hard drive, since you do not normaly use a program like installShield to accomplish this.

You could do this using C I am fairly sure since it is just parameter passing.  As for the windows scheduler then that again depends on your definition of install.

Let us know the exact purposes of what you need.
Avatar of Discomonkey
Discomonkey

ASKER

Here's exactly what I want to do:
I have a movie clip (movie.avi or movie.mpg)

I want to make a .exe that when executed will:

1) copy movie.avi to a directory on the hard drive
2) set movie.avi to play at a particular time (say 11:00 pm)

now I know you can set task scheduler (win 98 has it, don't know about other os) to add a task that would accomplish this.  How can I access task scheduler via my program (my thoughts are that it is impossible)

so the only other option would be to just rely on the program.  I have no idea how to accomplish this.
It is not easy or even doable if the movie has to be *packaged* with the .exe, and I think that is what you want: am I correct ?  That will inevitably result in one hell of a big executable file.

I cannot see why you would want to do this anyway; if the executable is to be run on machine X, then this implies the movie must reside on machine X; hence it would be infinitely easier to copy the movie *beforehand* to machine X and the rely on your program purely to execute it.  

Of course you could write a batch file that would copy it from, say a CD, without anyone knowing and then set this to be run at a certain time via the your program; the program could then sit idle (and invisible) in memory waiting to run the movie itself.

You also need to be more specific about the program intended to play the movie (eg realplayer, windows media) although if you use a batch file this is not a problem, but the problem with batch files is the dos window the appears.

This is certainly an interesting problem, and it would be interesting to hear what the purpose of it is :D

-- A prank on someone maybe ?


well its actually a small file like maybe 5 megs or so, but the purpose of the program is a prank, it's such an awesome idea, I guess I'll write it, hopefully no one comes by and steals this idea because its too good.  Basically me and a friend want to make a virus like program (not harmful, just when you run it it'll pop something up to distract the person) and what it REALLY does is install the video from the movie The Ring where its that random jibberish that's all freaky and have it play in the middle of hte night on a friends's computer, and splice in their name, and since we know exactly when it goes off, we're gonna call that person exactly when the movie ends.  MAN I'm freaked out just thinkin about it.
If you've never seen the movie, its really damn good, but pretty freaky at parts (since the whole movie is about a movie that kills people 7 days after they see it)

So basically its an elaborate prank, Windows media player would be the prefered player to use, and the computer is left on over night so there's no problems there.  any ideas?  the program that sits in memory is a good idea (hey that's virus)  not sure how to go about any of this htough
Yeah this is more than doable.  I would do it in C.  

It is even easier if you have VC++ as it provides an easy way to make an app window invisible but still doing something in the background if you get me.

As regards the time then you could hard code it into the program or pass it via the command line.  Of course this makes it more difficult as you need to parse the time to make sure it is in the correct format, but it is all doable.

As regards distracting the user with something else; this is not really necessary as the program when run will appear to be a placebo anyway.  Unless they run some sort of process viewer they will not know it is there.

So basically since you cannot easily package the video into the mpeg, you need two files:

1. The movie (never)
2. The exe that, when run, will first copy the movie to a specified directory and then sit dormant waiting for the time to come when the movie is to be played.

Sound ok ?

I will have a crack at this later my time (currently 9:20GMT).
ASKER CERTIFIED SOLUTION
Avatar of mrwad99
mrwad99
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
whoops the command to copy the file in the system() call should be

'copy'

not

'cp'

Damn Unix commands still stuck in my head from University...
AWESOME.  I haven't tested it yet, tonight i will, school has turned up the heat on me.  This looks good though I'm gonna play with it.  I'll get back to you asap.
Yo,

Did you ever try this code and did it work ?