Difference between revisions of "Widget:Html5media"

From Hackerspace ACKspace
Jump to: navigation, search
(copied over html5media widget from http://www.mediawikiwidgets.org/)
 
m (added some warning via JS)
 
(8 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
Created by [http://www.mediawikiwidgets.org/User:Taipan taipan]
 
Created by [http://www.mediawikiwidgets.org/User:Taipan taipan]
 +
 +
== preparing a video ==
 +
For format compatibility, go to [https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats Mozilla], or caniuse.com ([http://caniuse.com/#feat=mpeg4 MPEG-4/H.264], [http://caniuse.com/#feat=webm WebM], [http://caniuse.com/#feat=ogv Ogg/Theora])
 +
To convert a video (to progressive h264 mp4), use FFmpeg:
 +
<code>ffmpeg -i inputfile.avi -c:v libx264 -pix_fmt yuv420p -movflags faststart outputfile.mp4</code>
  
 
== Using this widget ==
 
== Using this widget ==
 
For information on how to use this widget, see [http://www.mediawikiwidgets.org/Html5media widget description page on MediaWikiWidgets.org].
 
For information on how to use this widget, see [http://www.mediawikiwidgets.org/Html5media widget description page on MediaWikiWidgets.org].
 +
 +
You can use the <code>filepath</code> special template reference like this:
 +
<code><nowiki>{{#Widget:Html5media|height=30|url={{filepath:voice.mp3}}}}</nowiki></code>
  
 
== Copy to your site ==
 
== Copy to your site ==
 
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
 
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
</noinclude><includeonly><script src="http://api.html5media.info/1.1.4/html5media.min.js"></script><video src="<!--{$url|validate:url}-->" width="<!--{$width|default:425|validate:int|escape:'html'}-->" height="<!--{$height|default:355|validate:int|escape:'html'}-->"
+
</noinclude><includeonly>
controls preload></video></includeonly>
+
<script src="https://api.html5media.info/1.1.4/html5media.min.js"></script><video src="<!--{$url|validate:url}-->" width="<!--{$width|default:425|validate:int|escape:'html'}-->" height="<!--{$height|default:355|validate:int|escape:'html'}-->"
 +
controls preload></video><script type="application/javascript">if ( "<!--{$url|validate:url}-->"==="" )document.write("no video file provided: upload one")</script>
 +
</includeonly>

Latest revision as of 17:08, 13 November 2017

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

Created by taipan

preparing a video

For format compatibility, go to Mozilla, or caniuse.com (MPEG-4/H.264, WebM, Ogg/Theora) To convert a video (to progressive h264 mp4), use FFmpeg: ffmpeg -i inputfile.avi -c:v libx264 -pix_fmt yuv420p -movflags faststart outputfile.mp4

Using this widget

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

You can use the filepath special template reference like this: {{#Widget:Html5media|height=30|url={{filepath:voice.mp3}}}}

Copy to your site

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