<?xml version="1.0" encoding="ISO-8859-1"?>

<xwikidoc>
<web>Macros</web>
<name>Video</name>
<language></language>
<defaultLanguage>en</defaultLanguage>
<translation>0</translation>
<parent></parent>
<creator>XWiki.GuillaumeLerouge</creator>
<author>XWiki.GuillaumeLerouge</author>
<customClass></customClass>
<contentAuthor>XWiki.GuillaumeLerouge</contentAuthor>
<creationDate>1204732459000</creationDate>
<date>1204735122000</date>
<contentUpdateDate>1204735122000</contentUpdateDate>
<version>2.1</version>
<title></title>
<template></template>
<defaultTemplate></defaultTemplate>
<validationScript></validationScript>
<comment></comment>
<minorEdit>false</minorEdit>
<object>
<class>
<name>XWiki.TagClass</name>
<customClass></customClass>
<customMapping></customMapping>
<defaultViewSheet></defaultViewSheet>
<defaultEditSheet></defaultEditSheet>
<defaultWeb></defaultWeb>
<nameField></nameField>
<validationScript></validationScript>
<tags>
<cache>0</cache>
<displayType>input</displayType>
<multiSelect>1</multiSelect>
<name>tags</name>
<number>1</number>
<prettyName>Tags</prettyName>
<relationalStorage>1</relationalStorage>
<separator> </separator>
<separators> ,|</separators>
<size>30</size>
<unmodifiable>0</unmodifiable>
<values></values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</tags>
</class>
<name>Macros.Video</name>
<number>0</number>
<className>XWiki.TagClass</className>
<property>
<tags/>
</property>
</object>
<content>
#macro(video $url)

#if ($url.indexOf("dailymotion") != "-1")

#set($id1 = $url.indexOf("video/"))
#set($id2 = $url.indexOf("_",$id1))
#set($id1 = $id1 + 6)
#set($dmid = $url.substring($id1, $id2))
&lt;div  style="border: 1px solid #000; width: 520px; height: 411px;"&gt;&lt;object width="520" height="411"&gt;&lt;param name="movie" value="http://www.dailymotion.com/swf/$dmid&amp;v3=1&amp;related=0"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed style="border: 1px solid #000;" src="http://www.dailymotion.com/swf/$dmid&amp;v3=1&amp;related=0" type="application/x-shockwave-flash" width="520" height="411" allowFullScreen="true" allowScriptAccess="always"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;

#elseif($url.indexOf("youtube") != "-1")

#set($iy1 = $url.indexOf("v="))
#set($iy1 = $iy1 + 2)
#set($iy2 = $iy1 + 11)
#set($ytid = $url.substring($iy1, $iy2))
&lt;div  style="border: 1px solid #000; width: 510px; height: 426px;"&gt;&lt;object width="510" height="426"&gt;&lt;param name="movie" value="http://www.youtube.com/v/$ytid"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/$ytid" type="application/x-shockwave-flash" wmode="transparent" width="510" height="426"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;

#elseif($url.indexOf("google") != "-1")

#set($ig1 = $url.indexOf("docid="))
#set($ig1 = $ig1 + 6)
#set($ig2 = $ig1 + 19)
#set($gvid = $url.substring($ig1, $ig2))
&lt;div style="text-align: right; width: 600px; height: 519px; border: 1px solid #000;"&gt;&lt;embed style="width:600px; height:519px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=$gvid" flashvars=""&gt; &lt;/embed&gt;&lt;/div&gt;

#else

#warning('The Video URL you entered does not match any of the video websites supported by this macro. &lt;br /&gt;
Please check the address you entered or improve the macro to make it support this website :-\)')

#end

#end</content>
</xwikidoc>
