Add the Video Player to the Window

Now that you have created a stack window and saved your work it is time to start adding objects to your window. Let's start with adding an object that can play QuickTime videos. In Revolution the Player object can do this.

Add Player Object To Stack Window

Add Player Object To Stack Window

Locate the Player object icon in the Tools palette (1). Click on drag the Player object from the Tools palette onto your stack window.

After you drop the Player object onto your stack window your window should look something like this.

Edit Player Object Properties

Edit Player Object Properties

Now you need to give the Player object a name and load a video to play. You can perform both of these actions from within the Object Inspector. To open the Object Inspector for the Player:

1) Make sure the Edit tool is selected in the Tools palette.

2) Select the Player (selection handles will appear around the Player)

3) Choose Object > Inspector

Set Name and Source

Set Name and Source

With the Object Inspector open name the Player object My Video (1). Next, click on the folder icon next to the Source field (2). This will display a file selection dialog allowing you to select a movie file.

Select Movie File

Select Movie File

Locate a QuickTime compatible movie file on your computer and click Open to load the movie.

The Result

The Result

The movie file should load into the Player object. In this example the movie dimensions are larger than the stack window. By default Revolution resizes the Player object to the dimensions of the movie file automatically. This has caused the Player object to be larger than the stack window.

Resize Stack Window

Resize Stack Window

Resize the stack window so that the Player object fits within it. You can resize the stack window like you would any other window on your operating system.

Center The Player Object

Center The Player Object

Now click on the Player object and drag it so that it appears centered within the stack window.

Play The Movie

Play The Movie

Now you can preview the movie. To play the movie select the Browse tool in the Tools palette.

After selecting the Browse tool you can click on the play button to play the video.

Next Steps

Now that you have created a Player object we will look at how to create a menu and dynamically load a movie based on the menu selection.

17 Comments

Revnewbbie

I have tried this several times but when I place the video player on a stack, it is placed as a plain box, there are no controls, i.e. play, pause, sound, etc. Also in the object inspector, though I have selected the file, there are no entries in the time current time box or the "of" display. What am I doing wrong?

Trevor DeVore

Are you trying this on Mac or Windows? If you are on Windows, do you have QuickTime installed?

Dave Campbell

FYI - I had the same problem.
Windows Vista - I did have QT installed, but had no QT player in LiveCode
But after updating QT the player worked!

Larry Williams

Hi

Is their a way to have a playlist that will play a movie based from a streaming video or is this just a video player based on folders.

thanks

Trevor DeVore

Larry - The playlist in this tutorial is generated using files in a folder but there is no reason you cannot set the 'filename' property of a player object to a URL rather than a filename. The LiveCode player object will stream the URL for you automatically.

You would just need to come up with a different way of creating the playlist.

carolyn

I get to set name and source - select the .mov file but the time never loads and I never get the next screen. What am I doing wrong? The .mov file does work on my computer so the file isn't corrupt.

Hanson Schmidt-Cornelius

Hi Carolyn,

as you state that the movie plays on your machine, I assume that you already have quicktime installed and not an other player.
When you say: "the time never loads", then I assume you are referring to the controls that appear at the bottom of the player window, which indicate the play times of the movie. If these disappear from your stack window after loading the movie, then it is likely that your movie dimensions are larger than the stack window and the controls have moved beyond the boundaries of the stack window. Try enlarging the stack window and see if the controls appear again.

Kind Regards,

Hanson

karellin

As Revnewbbbie above, I see neither the movie nor the visual controls for the movie. I have QT 7.73 installed on Win 7 32-bit; it works. I have tried enlarging the stack window to no avail.It would help me to know more than just the month, date, and time of the comment.

Hanson Schmidt-Cornelius

Hi Karellin,

that is puzzling. If you do not see the control when you drag the QuickTime Player Object, then LiveCode does not seem to be aware of the QuickTime installation.

I have the same version of QuickTime installed and am able to play quicktime movies through LiveCode. Did you try restarting LiveCode after you installed QuickTime?

Kind Regards,

Hanson

Karellin

Hanson,

Repeated the experiment an another computer, and still no joy. QT 7.7.3 is installed and set as the default player for QuickTime. mov files. Live Code does not display the player controls when the player is dragged on to the mainstack.

Any chance that I am making some kind of non-obvious error?

Hanson Schmidt-Cornelius

Hi Steve,

can't think of anything obvious here.

Have you tried showing the controller of the player? This should be visible by default, but maybe it is set to false for some reason. You can make the controller of a dragged on player visible by using the following syntax: set the showController of "player" to true

You could also test if the "dontUseQT" property is set to true, preventing QuickTime from being used.

You can find more information on these properties in the LiveCode dictionary.

Hope this helps you.

Kind Regards,

Hanson

John

Will this work on Linux ?

ilai1234

When I place the video player i see a plain box please help

Elanor Buchanan

Hi ilai1234,

What platform are you on and which edition and version of LiveCode are you using?

You might find this lesson helpful, it is more specific to using players.

https://lessons.livecode.com/m/4603/l/44283-using-players

Kind regards

Elanor

ilai1234

I tried that already im on windows 10 and im not near my pc so i cant tell you the version of the livecode im using

Elanor Buchanan

Hi

I have done a quick test on Windows 10 and it works ok here. When you get a chance if you can let us know the version and edition of LiveCode we can look into this.

Elanor

ilai1234

Im using the seven point one point four but ill update to the latest version and than ill check if it works

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.