<doc>
	<legacy_id>1173</legacy_id>
	<name>play</name>
	<type>command</type>

	<syntax>
		<example>play [<i>filePath</i> | <i>type</i>] [looping] [at <i>point</i>] [options <i>xOptions</i>]</example>
		<example>play [stop | pause | resume | step {forward | back}] [<i>type</i>] <i>clip</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Plays a movie or sound.</summary>

	<examples>
<example>play &quot;/usr/local/clips/music.aiff&quot; </example>
<example>play videoClip &quot;Movie&quot; at 100,100 </example>
<example><p>play audioClip &quot;Trust No One&quot; looping</p></example>
<example>play &quot;/usr/local/clips/music.aiff&quot; </example>
	</examples>

	<history>
		<introduced version="1.0">Added. </introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Images  Multimedia</category>
	</classification>

	<references>
		<function tag="MCISendString">MCISendString Function</function>
		<function tag="QTVersion">QTVersion Function</function>
		<command tag="prepare">prepare Command</command>
		<command tag="beep">beep Command</command>
		<command tag="import">import Command</command>
		<command tag="start">start Command</command>
		<command tag="revStopAnimation">revStopAnimation Command</command>
		<command tag="stop">stop Command</command>
		<property tag="looping">looping Property</property>
		<property tag="callbacks">callbacks Property</property>
		<property tag="showSelection">showSelection Property</property>
		<property tag="dontRefresh">dontRefresh Property</property>
		<property tag="playRate">playRate Property</property>
		<property tag="playLoudness">playLoudness Property</property>
		<property tag="playDestination">playDestination Property</property>
		<property tag="currentTime">currentTime Property</property>
		<property tag="frameCount">frameCount Property</property>
		<message tag="playStopped">playStopped Message</message>
		<message tag="playStarted">playStarted Message</message>
	</references>

	<description>
	<overview>Use the <b>play</b> <glossary tag="command">command</glossary> to control playing of a movie or sound. </overview>

		<parameters>
<parameter>
	<name>filePath</name>
	<description>Is the location and name of the file you want to play. If you specify a name but not a location, LiveCode assumes the file is in the defaultFolder.</description>
</parameter>
<parameter>
	<name>type</name>
	<description>The type of clip to play.</description>
	<options title="">
		<option>
		  <item>audioClip</item>
		  <description></description>
		</option>
		<option>
		  <item>videoClip</item>
		  <description></description>
		</option>
	</options>
</parameter>
<parameter>
	<name>clip</name>
	<description>A reference to an audio clip or video clip in an open stack.</description>
</parameter>
<parameter>
	<name>point</name>
	<description>Specifies the center of the movie to be played, relative to the current stack window. If the <i>point</i> is not specified, the movie is positioned at the center of the current card. If a sound is being played, the <i>point</i> has no effect.</description>
</parameter>
<parameter>
	<name>xOptions</name>
	<description>Are command line parameters passed to the "xanim" package on Unix systems. (On Mac OS and Windows systems, this parameter has no effect.).</description>
</parameter>
		</parameters>

	<value></value>
	<comments>If you use the play ... looping form, the sound or video plays continuously from beginning to end until you stop it. <p></p><p>You can stop playing of a movie or sound with the <b>stop</b> <glossary tag="command">command</glossary> or with the play stop form. If you specify a <i>clip</i>, only that clip is stopped. If you specify a <i>type</i> but not a <i>clip</i>, the last clip of that type is stopped. (On <glossary tag="Unix">Unix systems</glossary>, you must wait a second or two after starting a movie or sound before you can stop it, to give the external player time to start up.)</p><p></p><p>To pause a movie, use the play pause form. Continue playing with play resume. You can move one frame backward or forward with the play step form. If you use one of these commands with a <i>clip</i> that is not currently playing, the <function tag="result">result</function> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> &quot;videoClip is not playing&quot;. If the <i>clip</i> is a sound, these forms simply play the sound, ignoring the words &quot;pause&quot;, &quot;resume&quot;, or &quot;step&quot;. </p><p></p><p>You can play multiple movies at once by starting each one of them with the <b>play</b> <glossary tag="command">command</glossary>. </p><p></p><p>Movies cannot be played while any tool other than the Browse tool is in use. </p><p></p><p>If you start playing an audio clip when another one is playing, the first audio clip is stopped, and a <b>playStopped</b> <keyword tag="message box">message</keyword> is sent to the <glossary tag="current card">current card</glossary>. You cannot play two sounds at the same time, nor can you queue a sound while another sound is playing. </p><p></p><p>On Unix systems, the &quot;xanim&quot; program must be located in a directory in the PATH environment variable. You can set the PATH from within LiveCode by using the <b>put</b> <glossary tag="command">command</glossary>:</p><p></p><p>  put newPath into $PATH</p><p></p><p>The <b>play</b> <glossary tag="command">command</glossary> does not work on some <glossary tag="Unix">Unix systems</glossary> that lack built-in support for sound. On these systems, when the <b>play</b> <glossary tag="command">command</glossary> <glossary tag="execute">executes</glossary>, the <function tag="result">result</function> is set to &quot;no sound support&quot;. </p></comments>
	</description>
</doc>