Page 1 of 1

import video into stack for use with iPad

Posted: Sat Dec 04, 2010 4:00 pm
by petero
For some reason, I am having trouble importing a movie into a stack (I want it to be embedded). I try File/Import as Control/Video, then select my video (either an mov file or a m4v file - each exported from Final Cut). But, nothing happens and nothing is imported. My goal is to be able to play back a short video in an iPad app.

Any ideas on what I might be doing wrong.? I must be missing something simple - or maybe its just the holiday season.

thanks in advance.

Peter

Re: import video into stack for use with iPad

Posted: Sat Dec 04, 2010 4:41 pm
by Klaus
Hi Peter,

tha supported playback of videofiles via "play videoclip XYZ" is VERY limited, and MP4 or M4V files are NOT supported in the DESKTOP version!
And since you can only use "play videofile" with external files on iDevices (see "Video playback support" in the iOS docs!) you could do this:

1. Import that videofile into a custom property of your stack like this:

Code: Select all

...
answer file "Where is the video file:"
set the cShortVideoClip of stack "xyz" to url("binfile:" & it)
## or ... of this stack
...
Now the binary video file is part of your stack but cannot be used so far, so you need to save it back to a file when the app starts on the iPad.
See also "File and folder handling" in the iOS docs.

2. "Spit it out" on the iDevice, if not already done:

Code: Select all

on openstack 
## or whenever

## Check if the video has alreday been saved on the iPad
if there is NOT a file (specialfolderpath("Documents") & "/ShortVideoClip.mp4") then
    put the the cShortVideoClip of this stack into url("binfile:" & specialfolderpath("Documents") & "/ShortVideoClip.mp4")
end if
...
end openstack
3. Now the video is ready for playback with
...
play (specialfolderpath("Documents") & "/ShortVideoClip.mp4")
...

Not tested, but should work :D


best

Klaus