Video does not show in standalone

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
exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Location: Belgium
Contact:

Video does not show in standalone

Post by exheusden » Tue Oct 03, 2017 10:00 am

Very simple stack, just one card with a player object, whose path points to an mp4 video file. Works fine in LiveCode, but when a standalone is made, the video frame is shown, but without the video. I have tried referencing the mp4 file in the Copy Files section of Standalone Settings, but this just causes the stand alone to freeze when starting, not even displaying the application window.

LiveCode Community Edition 8.1.6; macOS 10.12.5

ittarter
Posts: 151
Joined: Sat Jun 13, 2015 2:13 pm

Re: Video does not show in standalone

Post by ittarter » Tue Oct 03, 2017 11:39 am

Hi exheusden

You need more information to determine the nature of the problem.
You do not need to reference the file in copy files when creating your standalone, but you do need to make sure that the video player is able to find the file.

Add a button to your standalone to test the URL in the video player, to see if the filename is correct.

Code: Select all

on mouseup
   answer the filename of player "MyPlayer"
end mouseup
if it appears correct, add a second button and a field, to test alternate filenames

Code: Select all

on mouseup
   set the filename of player "MyPlayer" to fld "TestThisURL"
end mouseup
Remember that if even one character is wrong (like a front slash) the application will probably not find the file.

Another important factor is setting the property defaultfolder so that your application can find the file. (Look up this term in the LC dictionary for more information.) You could add a third button:

Code: Select all

on mouseup
   answer the defaultfolder
end mouseup
to see where your application is trying to find the file. You may be surprised. In which case you may wish to set the defaultfolder to a different value, or adjust the filename accordingly.

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

Re: Video does not show in standalone

Post by Klaus » Tue Oct 03, 2017 2:20 pm

Please show us the script where you set the filename of your video!
Or what did you set as the filename maybe manually?

Mostly these are pathname problems in a standalone.

exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Location: Belgium
Contact:

Re: Video does not show in standalone

Post by exheusden » Tue Oct 03, 2017 3:48 pm

In the player object inspector, the Source is entered simply as Happy.mp4 (the name of the video file, which is situated in the same folder as the LC stack). This plays fine in LC itself.

When tested in the standalone with the suggested button, the filename returned is Happy.mp4

Note that the video is not displayed in the standalone, even when the mp4 file is in the same folder as the standalone player (I assume that, as the file need not be referenced in Copy Files, that the video is not copied into the standalone and must therefore still be findable).

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

Re: Video does not show in standalone

Post by Klaus » Tue Oct 03, 2017 6:08 pm

You should never rely on "the defaultfolder" unless you know exactly where this currently is!

In a Mac standalone it used to be inside of the application package, but I also noticed it to be
the folder containing the *.app! So better add your video via the copy files" tab in the standalone
builder settings and use a little script to set the filename. This will also work on any other platform.

Code: Select all

on opencard
  set the filename of player "xyz" to (specialfolderpath("resources" & "/Happy.mp4")
end opencard
That should cure the inconvenience. :D


Best

Klaus

exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Location: Belgium
Contact:

Re: Video does not show in standalone

Post by exheusden » Tue Oct 03, 2017 7:32 pm

Klaus, you're talking to someone who has only a very basic knowledge of LiveCode—HyperCard, no problem, but LC I find highly confusing (I even bought the printed documentation that was issued earlier this year and simply can't get on with it, as it does not have an index). I assure you that I do not rely on "the defaultFolder", at least not consciously, as I don't know what it is!

Anyway, I have now added your openCard script (with the addition of a missing close-bracket) and also added the video to the Copy File standalone settings. As indicated in my original post, however, when the video is added to the Copy File settings, the generated standalone hangs on opening, not even displaying an application window, and I have to Force Quit it.

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

Re: Video does not show in standalone

Post by Klaus » Tue Oct 03, 2017 7:39 pm

Hm, does the video play in the IDE?

exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Location: Belgium
Contact:

Re: Video does not show in standalone

Post by exheusden » Tue Oct 03, 2017 10:09 pm

Yes, perfectly.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”