With the <media> element, provides parallel playback of separate media sources of differing types.
<par></par>
None.
The <par> element, allows simultaneous playback of multiple media resources during a video call. In this implementation, you can simultaneously play back a single audio and a single video stream from separate sources.
Specify the media streams using child <media> elements. Exactly two such elements must be specified: one specifying an audio-only source and the other specifying a video-only source. If one of the elements references an audio-video source, playback does not occur.
For the audio source, the <media> element can either:
Reference an external source using the src or expr attribute, or
Enclose the audio in an inline SSML document by specifying a type of application/ssml+xml.
For the media source, the <media> element must reference an external source using the src or expr attribute.
If one of the sources cannot be played (for example, because of an error fetching a file), the other is still rendered. If a <par> element executes while in a voice call, only the audio stream plays.
The following restrictions apply to the use of <par>:
Exactly two <media> elements must be specified. If this condition is violated, an error.semantic is raised.
A <prompt> element containing <par> cannot contain any other child elements. To queue audio before or after the parallel playback, place the audio in a separate <prompt> element. A <prompt> element must be either parallel or sequential, and not a combination of both.
In the current implementation it is not possible to reference more than one consecutive audio or video source in a single <media> element during parallel playback. For example, if the audio <media> element contains inline SSML that uses text-to-speech, that SSML cannot also contain an <audio> or <media> element referencing an external source. The <seq> element is not currently supported.
The <property> element is currently not supported when it is used as a child of <par>.
Since the Programmable Media Platform must synchronize the start of audio and video playback, it is recommended that the real-time streaming protocol (RTSP) be used when playing back files longer than one minute. If an HTTP or local file is referenced, a large amount of audio data might need to be buffered while waiting for the video stream, or vice-versa. This degrades performance, and in the case of very long files, may prevent playback from succeeding at all.
The following example shows how the <par> element can use the src attribute of the <media> element to reference an audio source and a video source:
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<par>
<media src="http://example.org/video.3gp"/> <!-- Video only -->
<media src="http://example.org/audio.3gp"/> <!-- Audio only -->
</par>
</prompt>
</block>
</form>
</vxml>
The following example , shows how the <par > element can enclose an audio phrase an inline SSML document. In this case, the <media> element must specify a type of application/ssml+xml.
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="num_messages" expr="3"/>
<form>
<block>
<prompt>
<par>
<media src="rtsp://example.org/avatar.3gp"/> <!-- Video only -->
<media type="application/ssml+xml">
<speak version="1.0" xml:lang="en-GB">
Welcome to your Video Mail account!
You have <value expr="num_messages"/> messages.
</speak>
</media>
</par>
</prompt>
</block>
</form>
</vxml>