Html5player

By MechaLynxMechaLynx

Description

Currently we only have a Flash-based option for audio and video inclusion. These snippets fix that by providing an HTML5-based alternative (which should really be the default by now).

Code

You can create audio and video embeds like this:

[[include :snippets:html5player
|type=audio
|url=audio file url
]]

If you want the file to play automatically, do it this way:

[[include :snippets:html5player
|type=video
|url=video file url
|autoplay=true
]]

type should be "video" or "audio".
autoplay is optional and only takes the value "true" if you use it. It's off by default.

Due to how the audio and video elements are implemented, they are not stylable this way, but this embed can of course be extended to provide a custom layout which can be styled.

In action


Thanks to tsangk for this great snippet: conditional-blocks


text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]



Other snippets posted by MechaLynx


Rate this solution

If you think this solution is useful — rate it up!

rating: +37+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License