I am using dokuWiki – which is a great and simple open-source tool for maintaining documentation – for several of my projects and today I had a need to add YouTube video to a dokuWiki page. I could not find a way to do that in Google or at first sight also in dokuWiki documentation, but Andreas (the creator of dokuWiki) helped me out in comments to this post.
As per Andreas’ comment, dokuWiki in fact does have a built-in feature for embedding Youtube videos as well as other Flash objects and it is plain simple – add following code when editing a dokuWiki page:
Just replace the red part with your Youtube video code and there you go. Just make sure your dokuWiki version is up to date. As Andreas also explained, opening up the HTML code using the example below allows XSS vulnerabilities, therefore it is not recommended.
First, I hopefully looked if dokuWiki might already have a built-in feature for that as it has been evolving rapidly, but sadly – no. Then, logically, I looked at dokuWiki plugins section. In there and in Google results I found 3 potential plugins that by their description might have been useful:
- youtube plugin – the script itself points to a URL of a domain parking page, meaning – the domain had expired
- youtubev2 plugin – says it has a XSS vulnerability and is not recommended for use
- flash plugin – could not get it to work
I had an impression that dokuWiki community was already considerable, so I was a bit disappointed there was no plugin for such a simple task. Then googling around I found a reference to a similar solution not specifically for dokuWiki, BUT it did work for dokuWiki just fine:
To add Youtube video to a dokuWiki page, here is a code you simply must use when editing a dokuWiki page:
|<html><object width=”400″ height=”333″><param name=”movie”
type=”application/x-shockwave-flash” wmode=”transparent” width=”400″
Just change the Youtube video code (red part in code) to the one of your own video – please note that it differs from the actulal Youtube video URL. This code embeds the actual video in a wiki page instead of just adding a thumbnail or link to it. Aparently, this code structure might work for other needs of embedding other HTML objects in dokuWiki pages.