Playing a movie
In this recipe, we will create a card that automatically plays an embedded movie when the card is loaded.
Getting ready
The sample.mov
video file is provided on the book's website.
How to do it...
Follow the steps in this recipe to create the necessary controls that can play a movie using LiveCode:
Create a new main stack in LiveCode with the following properties:
Height:
360
Width:
480
backgroundColor: Black
- Use the Standalone Application Settings dialog window and select the icon.
Use the Add Files dialog box to upload the
sample.mov
file. Once this is done, your dialog window should look similar to the following screenshot:Close the Standalone Application Settings dialog window.
Add the following code to the card:
on openCard mobileControlCreate "player", "myController" mobileControlSet "myController", "filename", specialFolderPath("engine") & "/sample.mov" mobileControlSet "myController", "visible", true mobileControlSet "myController", "rect", "1,1,481,361...