Changes for page Video Macro

Last modified by Ludovic Dubost on 2023/04/25 09:12

From version 6.1
edited by Ludovic Dubost
on 2019/05/20 19:05
Change comment: Install extension [org.xwiki.contrib:macro-video/1.14]
To version 5.1
edited by Ludovic Dubost
on 2018/12/09 12:30
Change comment: Install extension [org.xwiki.contrib:macro-video/1.13]

Summary

Details

XWiki.WikiMacroClass[0]
Cached
... ... @@ -1,1 +1,0 @@
1 -No
Asynchronous rendering
... ... @@ -1,1 +1,0 @@
1 -No
Macro code
... ... @@ -1,5 +1,6 @@
1 -{{velocity}}
2 -## Compute the URL of the embedded video from the original web URL.
1 +{{velocity output="false"}}
2 +Compute the URL of the embedded video from the original web URL.
3 +
3 3  #set ($url = '')
4 4  #if ($xcontext.macro.params.url.indexOf('dailymotion') != -1)
5 5   ## DailyMotion URLs have the following format:
... ... @@ -40,7 +40,7 @@
40 40  ## The ratio value is used to compute a bootstrap css class: embed-responsive-16by9.
41 41  #if ($xcontext.macro.params.ratio)
42 42   #set ($ratio = $xcontext.macro.params.ratio.replace(':', 'by'))
43 - #set ($embedContainerClass = " class='embed-responsive embed-responsive-$ratio'")
44 + #set ($embedContainerClass = "class='embed-responsive embed-responsive-$ratio'")
44 44   #set ($embedItemClass = 'embed-responsive-item')
45 45   #set ($width = '100%')
46 46   #set ($height = '100%')
... ... @@ -48,10 +48,10 @@
48 48  #set ($width = "width=$width")
49 49  #set ($height = "height=$height")
50 50  {{/velocity}}
51 -
52 -{{velocity}}#if ("$!url" != '')
52 +{{velocity}}
53 +#if ("$!url" != '')
53 53   {{html clean="false"}}
54 - <div$!{embedContainerClass}>
55 + <div $!embedContainerClass>
55 55   #if ($xcontext.macro.params.url.indexOf('google') != -1)
56 56   <object class="$!embedItemClass" $!width $!height type="application/x-shockwave-flash" data="$!url">
57 57   <param name="movie" value="$!url"></param>