Name: play video

Type: command

Syntax: play video {<videoFile> | <videoUrl>}

Summary:
Plays a full screen video.

Introduced: 4.5.2

OS: ios, android

Platforms: mobile

Example:
play video myVideoFile

Example:
put specialFolderPath("engine") & "/intro_movie.mp4" into tVideoFile
play video tVideoFile

Example:
play video "http://www.livecode.com/buildanapp.mp4"

Returns:
The <play video> command will not return until it is complete or the
user dismisses it.

Description:
Use the <play video> command to play a full screen video.

The playback uses iOS's built-in video playback support (MPMoviePlayer),
and as such can use any video file supported by MPMoviePlayer, including
MP4s. 

On iOS 3.1.3 the video always plays with landscape orientation. On iOS
3.2 and later the orientation of the video is tied to the current
interface orientation.

Appearance of the controller is tied to the <showController> property of
the <templatePlayer>. Changing this property to true or false will cause
the controller to be shown or hidden.

When a movie is played without a controller any touch on the screen
results in a <movieTouched> message being sent to the object whose
script started the video. The principal purpose of this message is to
allow the <play stop> command to be used.

>*Note:*  The <movieTouched> message is not sent if the video is playing
> with <showController> set to true.

Playing a video can be made to loop by setting the <looping> property of
the <templatePlayer> to true before executing the <play video> command.
Looping a video is only supported on iOS 3.2 and later.

A section of a video can be played by setting the <playSelection>
property of the <templatePlayer> to true before executing the <play video>
command. This will use the <startTime> and <endTime> properties of the
<templatePlayer> to determine what section to play. The values of these
properties are interpreted as the number of milliseconds from the
beginning of the video.

Parameters:
videoFile (string): The path to a video file to play.

videoUrl (string): The url of a video file to play.

References: play stop (command), play (command), templatePlayer (keyword),
movieTouched (message), looping (property), endTime (property),
playSelection (property), showController (property), startTime (property)

Tags: multimedia
