LiveCode allows you to play sound and video within your appication using the player object.
Adding a Player Object
Setting the Filename of the Player
You set the filename property of the player object to tell it which sound or movie file to play.
Open the Property Inspector for the player and click the button next to the Source, this allows you to select an external file to be played.
You can also set the filename property of a player in script, for example:
set the filename of player "sound" to "G:/Documents/Elanor/Projects/Getting Started Lessons/hiscore.m4a"
Using the Player Controller
Controlling the Player in Script
If you don't want your users to have control of the video, or you prefer not to show the controller and add your own objects to control play back, then you can use LiveCode scripts to control the video.
Open the Property Inspector for the player and turn off the controller. You can then use the following commands and properties to control play back.
start command - Resumes playing a paused movie or sound e.g.
start player "movie"
stop command - Stops a currently playing movie or sound e.g.
stop player "movie"
currentTime property - Specifies the elapsed time in a movie or sound, by setting this you can skip forward or back e.g.
set the currentTime of player "movie" to 12000
Referencing Files on a Server
You can also set the filename property of a player to an http URL.
If you specify a URL for a streaming QuickTime movie file, LiveCode displays the movie sequentially as it downloads. Otherwise, LiveCode must download the entire file before you can play it. To pre-fetch a file from the Internet in order to speed up access to it, use the load command before visiting the card that holds the player or image that references the file's URL.
Using Players on iOS
LiveCode players are only supported in desktop applications. If you want to use a player in an iOS application you can use an iosPlayer object, this is a native iOS control that displays a movie. For more information on using iOS players see this lesson.