Changes for page Video Macro

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

From version 5.1
edited by Ludovic Dubost
on 2018/12/09 12:30
Change comment: Install extension [org.xwiki.contrib:macro-video/1.13]
To version 7.1
edited by Ludovic Dubost
on 2019/08/02 10:59
Change comment: Migrated property [contentJavaType] from class [XWiki.WikiMacroClass]

Summary

Details

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