Streaming Video?

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

Streaming Video?

Post by derr1ck » Wed Apr 17, 2013 3:54 pm

Hi All,

I'm working on a new small project that's based on the video player tutorial. I would like to be able to select a folder on another mac on the same network, list those video files and allow the user to play them back within the app. The app will need to automatically enter network sign on credentials to access that machine. I don't want to have to download the files to the users machine, just list the files available in that folder and allow playback of the .mov file.

Thanks for any help on this!! :D

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Streaming Video?

Post by bn » Wed Apr 17, 2013 7:54 pm

Hi Derr1ck,

I use AppleScript to connect to a Mac on the network and then play .mov files on the local Mac. I don't see any native way for LiveCode to connect to the remote Mac. But luckily it is easy to use AppleScript from within LiveCode. You would have to allow access on the remote Mac. And you would have to know the username and the password on the remote Mac. This is all on a local network behind a firewall.
Actually I mount the remote mac as a volume via Applescript at startUp and then navigate from within LiveCode to the mov-files.
Of course this has some security implications that might be of concern in certain situations.

the core of the connection AppleScript is

mount volume "afp://10.1.2.3/Video" as user name "userName" with password "password"

if you know the file structure of the remote server you could let your users browse within the folder for your .mov files.

Let me know if this is a way to go for you. If so I could post the LiveCode part of choosing the files also. It becomes a little tricky on the Mac side if multiple users connect to the same remote Mac.

Kind regards
Bernd

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

Re: Streaming Video?

Post by derr1ck » Wed Apr 17, 2013 11:18 pm

Thanks Bernd,

This is exactly what I had in mind :D any further code in helping would be great!!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Streaming Video?

Post by bn » Wed Apr 17, 2013 11:55 pm

Derrick,

I would suggest you try to mount the remote host with the Applescript I posted and if you get the remote host mounted you manually navigate to the folder you are looking for. In LiveCode you make a new stack with just one field.

Now you drag the folder where you have your .mov files onto the empty field in your new stack and drop the folder. This will give you the whole path to the remote folder. Put the path to the remote folder into a variable e.g. tPathToFolder

Code: Select all

if there is a folder tPathToFolder then
   answer file "choose movie file" with tPathToFolder with type "Quicktime file|mov|MooV"
else
   answer "remote folder not found"
end if
see if you can get this to work.

The easiest is to put a folder into the public folder, but other locations can also be accessed, depending on permissions.

Kind regards
Bernd

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

Re: Streaming Video?

Post by derr1ck » Thu Apr 18, 2013 11:45 am

Thanks Bernd,

It has now been decided that the app should connect via SFTP instead, I take it this would be done in the same way or is there sftp support within livecode?.

Thanks again.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Streaming Video?

Post by bn » Thu Apr 18, 2013 12:48 pm

Derrick,

unfortunately I don't know nothing about SFTP. And from what I gather SFTP is not supported by LiveCode to the grief of many. (please correct me if I am mistaken re SFTP)

I think there are some Apple solutions to set up a video server like Broadcast and Server. I did only try this years ago shortly. You would have to dig into this. Might be easier than SFTP.

Kind regards
Bernd

Post Reply

Return to “Mac OS”