Home -> VRSmarty plugins page -> youtube.swf
This plugin is completely free for use in any context or connection.
youtube.swf
This plugin generates an embedded YouTube player.

You can set the size of the player, and if you want a video to start playing automatically or to be cued in pause mode. You can at any time load a new video with a VRSmarty command.
The following hotspot attributes are supported:

sizesize="320:280"player size, format="width:height"
embeddedembedded="false"player mode, see NOTES
onStartonStart="playv7"VRSmarty command to execute at init



Plugin attributes:set with spot_id.content.name=value
sizesize='320:280'set player size (width:height), default=480:360


Plugin methods: call with spot_id.content.name(value)
play('id')
play()
play('ht7ZLDFyKsQ')
play()
play video with id=...
continue playing after pause()
cue('id')cue('ht7ZLDFyKsQ')cue video with id=...
pause()pause()pause video
stop()stop()stop video



NOTES:

Attribute embedded="true" means that the player will have controls and a progress bar just like on the YouTube site. This is the default mode. Setting it to embedded="false" will remove all controls and only show the video. However, you can still control the video with the plugin commands.


You can get the id of a YouTube video easily by looking at the YouTube url. It is the content of the v parameter:

http://www.youtube.com/watch?v=ht7ZLDFyKsQ&feature=feedrec_grec_index


Use the play('id') command to load a video that should start playing immediately. Otherwise, use the cue('id') command, which will keep the video in paused mode until the viewer wants to press the play button, or until you want it to start with a play() command.


Example VRSmarty XML file:
<!-- ********************************* YouTube player ********************************* -->
<spot id="youtube" url="../plugins/YouTube.swf" linked="MariaHill" type="static" layerType="pano" staticAlign="TC" align="TC" staticX="0" staticY="15" display="F4" blockMouse="true" mouseChildren="true" buttonMode="false" 
   embedded="1" size="320:280" onStart="video5"
/>
					


Version history: