Standalone Application and Videos

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

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
lmorris
Posts: 2
Joined: Mon May 02, 2016 3:02 am

Standalone Application and Videos

Post by lmorris » Mon May 02, 2016 3:07 am

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Standalone Application and Videos

Post by Simon » Mon May 02, 2016 6:10 am

Hi Lindsey,
Welcome to the forum! :)

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

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

lmorris
Posts: 2
Joined: Mon May 02, 2016 3:02 am

Re: Standalone Application and Videos

Post by lmorris » Tue May 03, 2016 12:08 am

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?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Standalone Application and Videos

Post by Simon » Tue May 03, 2016 12:12 am

Hi Lindsey,
Check out specialFolderPath("Resources") in the dictionary. :)
Should do it for you.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

okk
Posts: 125
Joined: Wed Feb 04, 2015 11:37 am

Re: Standalone Application and Videos

Post by okk » Thu May 05, 2016 10:53 pm

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

Post Reply

Return to “Mac OS”