DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:flowplay

Flowplay Plugin

Compatible with DokuWiki

2006-11-06

plugin Integrates the flowplayer to stream video to an embedded flash applet (like on YouTube)

Last updated on
2007-02-22
Provides
Syntax
Conflicts with
flowplay2
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.

Description

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 ;-)

Demo pages

You got this plugin up and running? You have got a demo page? Put a link here!

Acknowledgements

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)

Installation

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"

Configuration

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

Usage is divided into two steps:

1. Re-encoding of your video file(s)

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.

2. Placing the video file on your page

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)

Updating to a newer release of FlowPlayer

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/.

Known Bugs

  • [2007-02-22: WORKAROUND implemented in v0.2] Does not work well if your wiki is on HTTPS. I found a workaround but it still requires HTTP access to the FlowPlayer.swf file and media.php. That means you have to allow access to DokuWiki via HTTP (which seems to be rather a bad idea, since you already put your wiki on HTTPS, doesn't it?). —Dave, edited 2007-02-22
  • There seems to be a behaviour change in PHP (from PHP4 → PHP5?) that prevents the size parameter from working in PHP5. To fix this, edit syntax.php and change the following line:
    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

  • Dokuwiki 2009-12-25c “Lemming” version. Need to edit syntax.php and change Line : 93
    $renderer->doc .= '     <param name="flashvars" value="config={videoFile:\''. ml($url) .'\', autoPlay:false, loop:false, showLoopButton:false}" /> '."\n";

    into

    $renderer->doc .= '     <param name="flashvars" value="config={videoFile:\''. $url .'\', autoPlay:false, loop:false, showLoopButton:false}" /> '."\n";

    just change ml($url) to $url —Jonathan Tsai(tryweb (at) ichiayi.com) 2010-02-26

Changelog

  • 2007-02-22 Version 0.2:
    • :!: Maybe you need to purge some cache after updating…
    • Workaround: flowplayer via HTTPS may work better if you use the player_base_url configuration setting
    • Behavior change: video files do not autostart anymore
    • Behavior change: video files do not loop anymore
    • Feature: Config shows up in configuration dialog
    • Languages: en, de
  • 2007-02-15 Version 0.1:
    • Initial release. Simply plays .flv files.
    • Known issues: Does not work well via HTTPS.
    • Wishlist: The video should not autostart nor loop ;-)

Discussion

  • I cannot change the size of the player: every time I try something different from the default I get width=320 and height=23 on the rendered HTML page. I am using 2007-05-24rc and flowplayer 1.18 but the default flowplayer 0.13 has the same odd behavior.
  • Same issue for me, using last version of flowplayer …
  • Same issue for me: example. gibson@cns.physics.gatech.edu, 2009-01-26
  • did not get this plugin running with DokuWiki-2009-12-25 can anybody confirm this? flowplugin2 works
plugin/flowplay.txt · Last modified: 2014/03/20 18:14 by Aleksandr