0 Votes

Changes for page JW Player

Last modified by Ryan C on 2025/04/30 07:54

From version 3.1
edited by Ryan C
on 2025/04/15 18:19
Change comment: Install extension [org.xwiki.contrib:macro-jwplayer/2.1.1]
To version 1.1
edited by Ryan C
on 2025/03/06 16:50
Change comment: Install extension [org.xwiki.contrib:macro-jwplayer/2.1.3]

Summary

Details

jwplayer.flash.swf
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.AdminAngriff
Size
... ... @@ -1,1 +1,0 @@
1 -139.3 KB
Content
jwplayer.html5.js
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.AdminAngriff
Size
... ... @@ -1,1 +1,0 @@
1 -131.1 KB
Content
jwplayer.js
Size
... ... @@ -1,1 +1,1 @@
1 -40.6 KB
1 +236.0 KB
Content
XWiki.JavaScriptExtension[0]
Code
... ... @@ -9,19 +9,16 @@
9 9   }
10 10  });
11 11  require(['jQueryNoConflict', 'jwplayer'], function($, jwplayer) {
12 + jwplayer.key="QowE9R/MhMc1H2U6HxMlLTxvbtbk+uhwkexhBQ==";
12 12   $('.jwplayer').each(function(index) {
13 13   var options = {
14 - file: this.alt
15 + file: $(this).attr('data-source'),
16 + autostart: $(this).hasClass('autostart'),
17 + repeat: $(this).hasClass('repeat')
15 15   };
16 - if($(this).hasClass('autostart')){
17 - options.autostart = true;
18 - }
19 - if($(this).hasClass('repeat')){
20 - options.repeat = true;
21 - }
22 - var width = $(this).attr('width');
19 + var width = $(this).attr('data-width');
23 23   width && (options.width = width);
24 - var height = $(this).attr('height');
21 + var height = $(this).attr('data-height');
25 25   height && (options.height = height);
26 26   this.id = this.id || ('jwplayer' + index);
27 27   jwplayer(this.id).setup(options);
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,6 +1,8 @@
1 1  {{velocity}}
2 +#set ($macroDocFullName = $xcontext.macro.doc.fullName)
3 +#set ($discard = $xwiki.ssx.use($macroDocFullName))
2 2  #if ($xcontext.action != 'edit')
3 - #set ($discard = $xwiki.jsx.use($xcontext.macro.doc.fullName))
5 + #set ($discard = $xwiki.jsx.use($macroDocFullName))
4 4  #end
5 5  #set ($reference = $xcontext.macro.params.attachment)
6 6  ## Allow the user to pass a path or an absolute URL.
... ... @@ -10,7 +10,21 @@
10 10  #end
11 11  #set ($width = $mathtool.toInteger($xcontext.macro.params.width))
12 12  #set ($height = $mathtool.toInteger($xcontext.macro.params.height))
13 -#set ($autostart = $xcontext.macro.params.autostart)
14 -#set ($repeat = $xcontext.macro.params.repeat)
15 -[[image:missing.png||class="jwplayer#if ($autostart == 'true') autostart#end#if ($repeat == 'true') repeat#end"#if ($width) width="$width"#end#if ($height) height="$height"#end alt="$reference"]]
15 +#set ($autostart = $xcontext.macro.params.autostart == 'true')
16 +#set ($repeat = $xcontext.macro.params.repeat == 'true')
17 +#set ($attributes = [
18 + "class='jwplayer#if ($autostart) autostart#end#if ($repeat) repeat#end'",
19 + "data-source='$reference'"
20 +])
21 +#if ($width)
22 + #set ($discard = $attributes.add("data-width='$width'"))
23 +#end
24 +#if ($height)
25 + #set ($discard = $attributes.add("data-height='$height'"))
26 +#end
27 +(% class="jwplayer-wrapper" %)(((
28 + (% $stringtool.join($attributes, ' ') %)(((
29 + Loading the video player...
30 + )))
31 +)))
16 16  {{/velocity}}
XWiki.StyleSheetExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +default
Code
... ... @@ -1,0 +1,3 @@
1 +.jwplayer-wrapper {
2 + margin-bottom: 10px;
3 +}
Content Type
... ... @@ -1,0 +1,1 @@
1 +CSS
Name
... ... @@ -1,0 +1,1 @@
1 +Style
Parse content
... ... @@ -1,0 +1,1 @@
1 +No
Use this extension
... ... @@ -1,0 +1,1 @@
1 +onDemand