Load Video from HD (solved)

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Xero
Posts: 152
Joined: Sat Jun 23, 2018 2:22 pm

Load Video from HD (solved)

Post by Xero » Fri Jul 06, 2018 1:31 pm

Hi,
Another stupid question!
I am rounding out a video analysis app, and just need to know the command that will allow a user to load a video from anywhere on a HD. Something like this:

Click on button, open up dialogue box that shows C:/ (or whatever),
Find a video, select it, get that path, use that path as the path of the video in player on screen.

Just like you would with any program or app.
Can't seem to find a way of doing it. Have done the Video Library tutorial, but that seems like a silly way of doing it: forcing a user to put accessible videos in one certain folder relative to standalone. Who would do that???
Looked through dictionary, but problem is... if you don't know what command to use, you can't find the command to use!

Thanks in advance.

(I have almost done this app... and I promise I will share the source here when done, as it covers using vector graphics, loading videos, playing videos and all the normal functions that go along with it. I even solved the problem of having to create rectangles in a certain order (i.e. top left to bottom right) that can be used in vector graphic drawing apps)
Last edited by Xero on Fri Jul 06, 2018 2:27 pm, edited 1 time in total.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Load Video from HD

Post by bogs » Fri Jul 06, 2018 2:00 pm

You may want to look into 'answerFile' {with type} in the dictionary, as that is how you'd build a typical file dialog.

From Brian's version of the dictionary here, where I typed "answer" into the search -

Code: Select all

answer files "Select the files you wish to process:"
if the result is not "Cancel" then
   put it into tChosenFiles
....
You might also try looking through Max's wiki, but generally all the information you might need should be readily available right there.
Image

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Load Video from HD

Post by Klaus » Fri Jul 06, 2018 2:08 pm

Hi Xero,

you need to unse -> answer file...

Code: Select all

...
## Will only show MP4 files in the dialog.
## You can supply a comma separated list of suffixes you want to allow resp. LC can play -> mp4,avi,mkv,mov...
answer file "Please select a video:" with type "Videos|mp4|"
put it into tVideoFile

## User clicked CANCEL:
if tVideoFile = EMPTY then
 exit to top
end if

## Now do something with the full path to the video in tVideoFile
set the filename of player "your player object here..." to tVideoFile
...
Best

Klaus

P.S.
May I ask a personal question? Xero is your name, right?
This is not really a common name, I only know a (deceased) english saxophone player with that name: Xero Slingsby (and the Works), heavy stuff :-)
https://www.youtube.com/watch?v=2_1tby7 ... gs=pl%2Cwn

Xero
Posts: 152
Joined: Sat Jun 23, 2018 2:22 pm

Re: Load Video from HD

Post by Xero » Fri Jul 06, 2018 2:27 pm

Thanks Klaus,
Yet again you're a font of all knowledge!
That should be part of a tutorial... I would have thought that would be common to need to do, but not obvious when it comes to the script.
As for my name... Xero is a pen name from the mid 90's when I was writing webpages in GeoCities (anyone remember that???). Not my real name, just one I use a lot!
XdM

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Load Video from HD (solved)

Post by Klaus » Fri Jul 06, 2018 3:49 pm

Glad I could help, but bogs was actually faster (THIS time)! :D

And thank you for the info about your name.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Load Video from HD (solved)

Post by bogs » Fri Jul 06, 2018 8:17 pm

See what happens when you explode neutron stars? :D
Image

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Load Video from HD (solved)

Post by Klaus » Fri Jul 06, 2018 8:45 pm

Yes, sure, mumble, mumble, muble...

Like, y'know, so many girls erm... stars, so little time. :?

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”