Playing videos form a directory

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
derr1ck
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 25
Joined: Wed Mar 30, 2011 11:14 pm

Playing videos form a directory

Post by derr1ck » Mon Jun 09, 2014 3:12 pm

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Playing videos form a directory

Post by dunbarx » Mon Jun 09, 2014 6:26 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7267
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Playing videos form a directory

Post by jacque » Mon Jun 09, 2014 7:01 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Playing videos form a directory

Post by dunbarx » Mon Jun 09, 2014 7:26 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7267
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Playing videos form a directory

Post by jacque » Mon Jun 09, 2014 8:26 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Mac OS”