Difference between revisions of "Widget:PlayWrap"

From No Subject - Encyclopedia of Psychoanalysis
Jump to: navigation, search
Line 16: Line 16:
 
     $('audio,video').mediaelementplayer({
 
     $('audio,video').mediaelementplayer({
 
         loop: true,
 
         loop: true,
         shuffle: true,
+
         shuffle: false,
 
         playlist: true,
 
         playlist: true,
 
         audioHeight: 30,
 
         audioHeight: 30,
Line 41: Line 41:
 
</ul>
 
</ul>
  
<audio controls="controls" autoplay="autoplay">
+
<audio controls="controls">
 
     <source src="<!--{$url1|validate:url}-->" title="<!--{$title1|escape:'html'|default:'Track 1'}-->" type="audio/mpeg"/>
 
     <source src="<!--{$url1|validate:url}-->" title="<!--{$title1|escape:'html'|default:'Track 1'}-->" type="audio/mpeg"/>
 
     <source src="<!--{$url2|validate:url}-->3" title="<!--{$title2|escape:'html'|default:'Track 2'}-->" type="audio/mpeg"/>
 
     <source src="<!--{$url2|validate:url}-->3" title="<!--{$title2|escape:'html'|default:'Track 2'}-->" type="audio/mpeg"/>
 
</audio>
 
</audio>
 +
<script>
 +
var mediaElements = document.querySelectorAll('video, audio');
 +
for (var i = 0, total = mediaElements.length; i < total; i++) {
 +
new MediaElementPlayer(mediaElements[i], {
 +
features: ['prevtrack', 'playpause', 'nexttrack', 'current', 'progress', 'duration', 'volume', 'playlist', 'shuffle', 'loop', 'fullscreen'],
 +
});
 +
}
 +
</script>
 
</div>
 
</div>
 
</includeonly>
 
</includeonly>

Revision as of 03:32, 4 July 2019

This widget allows you to embed HTML5 Video Media on your wiki page.

Created by taipan

Using this widget

For information on how to use this widget, see widget description page on MediaWikiWidgets.org.

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:PlayWrap.