Page 1 of 1

Playing videos form a directory

Posted: Mon Jun 09, 2014 3:12 pm
by derr1ck
Hi All,

If I have a list of video files on a server how can I use the video player to play in sequence whatever video files are in a directory. So far I have this working:-


on mouseup

put ("http://pathtovideofile/videofile.mov") into theURL
set the filename of player "Viewer1" to theURL
start player "Viewer1"

end mouseup

This so far plays a specific video file within the player.

Re: Playing videos form a directory

Posted: Mon Jun 09, 2014 6:26 pm
by dunbarx
Hi.

The "play" command is your friend. It hangs out with your other friend, the dictionary.

I am not being flip. It is not obvious where to find these things. That is what you have your BFF for, this forum.

Craig Newman

Re: Playing videos form a directory

Posted: Mon Jun 09, 2014 7:01 pm
by jacque
Actually, "start" is the right command for a player object. I think the question is how to cycle through a list of audio files.

Derrick, do you know the names of the files ahead of time, or do you need to read the list on the server? It is easier if you know what the names are so you don't have to ask the server to send them. In either case, you should write a handler that catches the "playStopped" message. That message will be sent when the playback ends (or when the user stops playback with the controller.) When the card receives that message, load and start the next file.

If you need help with that, let us know.

Re: Playing videos form a directory

Posted: Mon Jun 09, 2014 7:26 pm
by dunbarx
Jacque.

Did I misinterpret the dictionary:

"You can play multiple movies at once by starting each one of them with the play command."

I assumed these files would be queued sequentially.

"...at once..."? Surely this is not several windows playing at the same time? Or is it?

Craig

Re: Playing videos form a directory

Posted: Mon Jun 09, 2014 8:26 pm
by jacque
Yeah, I had to read it a couple of times too. I believe it's refering to only video or sound clips like the ones you can embed (though it works with files too.) It doesn't list a player object -- though in fact, it doesn't list any objects at all (which may be a clue, since this type of audio playback isn't attached to an object.) If you've tested and it does work with players, then you're right and it isn't specifically documented. I've always used "start" with players, since that's the official command.

You can play multiple players at once though too. Just start them all. There will be a miniscule lag between them, since the commands to start will execute sequentially. But I think the OP wants sequential playback.