flowplay plugin by Dave Kliczbor
Integrates the flowplayer to stream video to an embedded flash applet (like on YouTube)
Last updated on 2007-02-22. Provides Syntax.
Compatible with DokuWiki 2006-11-06.
Conflicts with flowplay2!
Similar to dailymotion, dailymotion_videozap, flashplayer, flowplay2, google_video, mp3play, video, youtube, youtubev2.
| Author | Dave Kliczbor (you may write him a mail in German and/or English) |
|---|---|
| Version | 0.2 (2007-02-22), bundled with FlowPlayer 0.13 |
| Status | experimental |
| Required DokuWiki version | tested with 2006-11-06 |
| Download | flowplay-0.2.zip, flowplay-0.2.tar.bz2 |
| Old revisions | flowplay-0.1.zip, flowplay-0.1.tar.bz2 |
| Drawbacks | You can play only .flv files, you'll have to recode them first before uploading. You also need to allow .flv files in your DokuWiki installation – see below. |
YouTube rocks – so start your own! With this plugin, you'll be able to easily show streaming video in your DokuWiki installation. All the visitor needs is a browser and a not too old version of a Flash Player – if he could play YouTube videos, he should be able to see DokuWiki videos too
You got this plugin up and running? You have got a demo page? Put a link here!
This plugin is merely a wrapper for the excellent FlowPlayer by Anssi Piirainen. I just wrote the glue to DokuWiki and bundled it with FlowPlayer.
Half of the plugin code was copied from the video plugin by Jason Byrne and Chris Smith (I just needed a template, and that code was similar enough to mine)
Download flowplay-0.2.zip or flowplay-0.2.tar.bz2 into your plugins folder (replace /path/to/dokuwiki with the real path on your server):
$ cd /path/to/dokuwiki/lib/plugins/ $ wget http://fsinfo.cs.uni-dortmund.de/~dave/flowplay-0.2.tar.bz2 $ tar xvjf flowplay-0.2.tar.bz2
You'll need to update your conf/mime.conf in order to get DokuWiki to accept .flv files as media (or use the txtconf plugin). Add the following line:
flv video/x-flashvideo
On the Linux shell, you also could use this command:
$ echo "flv video/x-flashvideo" >>/path/to/dokuwiki/conf/mime.conf"
In most cases, no additional configuration is needed. There are some rare cases when the video does not play… I haven't completely sorted it out, but you seem to get a better chance if you let the browser load the .swf file over HTTP. Then again, you may want to use another FlowPlayer installation on your server.
In both cases, you have one configuration variable to set:
$conf['plugin']['flowplay']['player_base_url'] = 'http://yourserver.tld/flowplayer-0.14/';
This example assumes that the URL of FlowPlayer.swf is: http://yourserver.tld/flowplayer-0.14/FlowPlayer.swf
Usage is divided into two steps:
This is the tricky part, so I'd rather point you to the documentation of the FlowPlayer regarding the encoding of .flv files… oh well, here's a line for linux:
$ ffmpeg -acodec mp3 -i inputfile.avi -s 320x240 -r 30 -ar 44100 -f flv outputfile.flv
Set the audio sample rate explicitly to 44100 (mostly in case the original audio data is at 48000), else you'll be apt to get audio and video out of sync
. The frame rate does not have to be at 30 fps, I suspect you should set it to whatever the original file contains (look closely at the output of mplayer on stdout for the framerate) – maybe it's okay to completely leave it out.
Maybe you'll need to recompile ffmpeg as outlined on the FlowPlayer encoding page (one sure sign for that is when ffmpeg does not report an audio stream in the output, but reports ”0kb audio” after encoding). I did have to on Ubuntu Edgy.
After re-encoding your video, upload it via DokuWiki's media manager into your DokuWiki installation or simply upload it anywhere on the web. The player (or rather: DokuWiki) can cope with both address syntaxes.
The syntax:
{{flowplay>path_to_mediafile.flv[width,height]}}
with width and height being optional. (In case you grew up with DOS syntax: the brackets ain't for showing that width and height are optional, they are part of the syntax!)
Four examples of valid syntax:
{{flowplay>http://foobar.tld/test.flv}}
{{flowplay>http://foobar.tld/test.flv[320,240]}}
{{flowplay>playground:test.flv}}
{{flowplay>playground:test.flv[320,240]}}
You may use .flv files inside or outside of your DokuWiki installation. You may set the width and height of the player area (please note that the player's height actually will be 23px higher than you set it to allow the control bar show up)
Whenever you encounter a newer release of the FlowPlayer, just unpack it into the DOKUWIKI/lib/plugins/flowplay/flowplayer/ directory. Since this plugin is just a wrapper, it should work with subsequent versions of the FlowPlayer.
As an alternative, you could just point the configuration variable $conf['plugin']['flowplay']['player_base_url'] to any flowplayer installation on your server. For example, if the URL of the FlowPlayer.swf file is http://yourserver.tld/flowplayer-0.14/FlowPlayer.swf, just set it to http://yourserver.tld/flowplayer-0.14/.
if (preg_match('/(.*)\[(.*)\]$/',trim($url),$matches=array()))
into
if (preg_match('/(.*)\[(.*)\]$/',trim($url),$matches))
(yes, the difference is only =array() – just delete it.) Will be fixed in 0.3. —Dave, 2007-03-18
player_base_url configuration setting.flv files.Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported