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
Standalone Application and Videos
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Standalone Application and Videos
Hi Lindsey,
Welcome to the forum!
What is the file path to the video's you add?
Simon
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!
Re: Standalone Application and Videos
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?
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Standalone Application and Videos
Hi Lindsey,
Check out specialFolderPath("Resources") in the dictionary.
Should do it for you.
Simon
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!
Re: Standalone Application and Videos
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:
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
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
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