Page 1 of 1

Standalone Application and Videos

Posted: Mon May 02, 2016 3:07 am
by lmorris
Hi,

I have an app with 4 small videos on different cards linked through a player. When I save it as a standalone (I have "copy referenced files" selected in standalone application settings) My videos do not play. I have searched and searched for an answer with no luck. This is my first app and I have very little experience. I am using a Mac. Thanks for any help!

Lindsey

Re: Standalone Application and Videos

Posted: Mon May 02, 2016 6:10 am
by Simon
Hi Lindsey,
Welcome to the forum! :)

What is the file path to the video's you add?

Simon

Re: Standalone Application and Videos

Posted: Tue May 03, 2016 12:08 am
by lmorris
I think that is what I need help with. I have them linked to where they are on my computer (I know that won't work). How do I do this so that they will be visible on the standalone?

Re: Standalone Application and Videos

Posted: Tue May 03, 2016 12:12 am
by Simon
Hi Lindsey,
Check out specialFolderPath("Resources") in the dictionary. :)
Should do it for you.

Simon

Re: Standalone Application and Videos

Posted: Thu May 05, 2016 10:53 pm
by okk
Hi Lindsey,
if I understood you correctly, you have a stack with 4 cards, on each card is a player object, and you set the filepath to your videos in the inspector of the player object. The problem here is, when you save your stack as standalone, the filepath to your videos is not correct anymore. Therefore your should set the filepath to your videos from a script, for example in a preOpenStack handler. Place something like this in your stack script:

Code: Select all

on preOpenStack
   set the filename of player "player1" of card "card1" to specialFolderPath("Resources") & "/video1.mp4"
   set the filename of player "player2"  of card "card2" to specialFolderPath("Resources") & "/video2.mp4"
end preOpenStack
Obviously, you have to name your player objects, cards and videos and then use the identical names in your script.

For this to work in the livecode environment you need to have your videos in the same directory than your livecode stack. When you save as standalone you should check "copy referenced files" - as you did. Livecode copies then the videos into a special folder hidden within your app. Now you can move your app anywhere, the filepath to the videos should be always correct. Let me know if you need further help.

Best
Oliver