By MechaLynx
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!
When I first tried this, It didn't work. This was due to my stupidity as I tried using a YouTube video URL. After I figured out my problem, it worked wonderfully. What's more, this was something I've been searching for for a while. My thanks.
"But as for me and my house, we shall serve the Lord."
sco-738-hd spotted, over
I need to enter the width option, to set for example width=100%
Can you help?
yes but how do I obtain such audio file url??
you can just send the document into your site,then click "files" and then click the document,the domain name can be used as the url.I hope this will help you.
I hope I've said that understandable.(My English is really broken)
有徒问跖以盗,答以圣,勇,义,知,仁
sorry, but how can i resize/force the video window to new height, width ?
thx !!!
Awesome ! Thank you for sharing this code. I'm still learning wikidot, but it doesn't look that hard !
Just found this and it's great! How simple yet perfect
And the autoplay feature is amazing
That's pretty good! Just saw this, after receiving an edit notification today :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Yeah I noticed my tags were incomplete :P thanks!
Thanks for this new standard!
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?