flashplayer plugin by Sam Hall
A flash player that plays various media formats.
Last updated on 2008-01-23. Provides Syntax.
Compatible with DokuWiki 2006-11-06.
Similar to dailymotion, dailymotion_videozap, flowplay, flowplay2, google_video, jukebox, video, youtube, youtubev2.
| Download | flashplayer.zip |
|---|---|
| Extended version by Arno Welzel using SWFObjects | http://arnowelzel.de/wiki/misc/flashplayer Update: New version 2009-04-16 (added “position” parameter to adjust the alignment) with JW Player 4.3 and generates valid XHTML and XHTML-Strict! |
(link fixed)
I've also updated the code to resolve most of the issues listed in the discussions section to date. So it should be compatible with PHP 4 now. Cheers, — Sam Hall 23.01.2008 15:21
This is a damn cool player that play various media formats. It simplifies embedding audio and movie files into your wiki pages.
See Flash Media Player for full details about what you can do with this player.
“The Flash Media player supports playback of a single media file of any format the Adobe Flash Player can handle (MP3,FLV,SWF,JPG,PNG or GIF). It also supports RSS/XSPF/ATOM playlist (with mixed mediatypes), a wide range of flashvars (settings) for tweaking both behavior and appearance and an extensive, documented javascript/actionscript API.”
You got this plugin up and running? You have got a demo page? Put a link here!
Tanja Schmidt (vocalist): http://tanjaschmidt.de (used for playing mp3-files)
Ed Bradburn (musician): http://www.tunemason.org (simple MP3 melodies; search for “Audio”)
York University: https://wiki.cse.yorku.ca/dept/tdb/wiki:plugins:flashplayer
Arno Welzel: http://arnowelzel.de/wiki/reviews/sandisk_cruzermicro8gb (extended version by myself, XHTML conform)
Paul Troost: http://www.greenbird.info/cplusplus/stereo_vision#results
I better thank Dave Kliczbor since I pretty much copy and pasted this page from his FlowPlay plugin, which is a similar plugin. Thanks mate! Now I'm going to steal some of your words to save some time… (No problem, Sam! I've got an almost unlimited supply of words, I can afford to share some
–Dave)
This plugin is merely a wrapper for the excellent Flash Media Player by Jeroen Wijering. I just wrote the glue to DokuWiki and bundled it with Flash Media Player.
This is my first plugin, and so you will probably recognize the skeleton as being pretty much the same as what was used in the one at the end of the syntax tutorial. So thanks to Christopher Smith for that sample code.
Download flashplayer.zip and extract the flashplayer folder into your plugins folder.
<flashplayer width=x height=y>flashvars</flashplayer>
Replace x and y with the height and width you would like, note that the slider is 20 pixels high, so if you want to display a movie that is 240 in height you would enter height=260.
Replace flashvars with the variables defined in the documentation for the player. This can be found at:
<YOUR DOKUWIKI ROOT>/lib/plugins/flashplayer/flash_media_player/readme/readme.html
The most basic flashvars string would be like:
file=http://<path>/<media filename>
Hello,
nice plugin, but it does not work with rewrite out of the box. You have to change line 67 in syntax.php and add '.DOKU_BASE.' as suffix to the .swf-path.
67: $renderer->doc .= '<embed src= "'.DOKU_BASE.'lib/plugins/flashplayer/flash_media_player/mediaplayer.swf" quality="high" width="'.$width.'" height="'.$height.'" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" flashvars= "';
Otherwise the player will not show up in the page.
— schneidexe 09.05.2007 22:17
Hi! very cool plugin. Doesn't work for PHP 5 unless you add:
if (!function_exists(“stripos”)) {
function stripos($str,$needle) {
return strpos(strtolower($str),strtolower($needle));
}
}
to syntax.php
Thanks for the input, I've now updated the the code to resolve these issues. — Sam Hall 23.01.2008 15:21
Hello, Since version 3.9 Flash Video Playe has been renamed to FLV Player. To simplify the upgrade, just copy the new flvplayer.swf (it's all we need because we use embed) to plugin dir and modify line 67 to reflect the change.
Hi, I have problems using your Plugin with Firefox 3 (mac OSX). The movies do not show up. With Safari everything seems to work… any idea?
— hubionmac 18.08.2008 00:21
Sorry, but EMBED is not a valid element in XHTML!
I extended the plugin to use SWFObjects to load the player via JavaScript (should literally work with any browser, tested with IE, Firefox, Opera), so the document is still valid XHMTL (tested with W3C and Validome) and there are localized, customizable messages for the message in case Flash is not installed or JavaScript is not activated (currently only in German and English, but since there are local language files, any other language is easy to add).
You can download this version at http://arnowelzel.de/wiki/misc/flashplayer.
I think this code should be made to use in PHP 4 the only functions that need to be replaced are two stripos() which don't even have to be case-insensitive anyways.
To make it work just replace all stripos with strpos or else you'll get a blank page and unless you have reporting on, you wont know why.
Where can I download the plugin ? The provided link is not working…
— mg 05.09.2008 21:53
Fixed. — Sam Hall 08.09.2008 11:37
If the fullscreen button is not working, open syntax.php and add allowfullscreen=true at line 68 :
$renderer->doc .= '<embed src= "'.DOKU_BASE.'lib/plugins/flashplayer/flash_media_player/player.swf" quality="high" width="'.$width.'" height="'.$height.'" allowScriptAccess="always" wmode="transparent" allowfullscreen=true type="application/x-shockwave-flash" flashvars= "';
This doesn't seem to work for me. I tried this, but the embed-tag is always rendered without the allowfullscreen=true. What's wrong here?OK, solved. You need to restart apache. It doesn't matter if you move the flashplayer folder on the fly, apache seems to catch the older php file.
Well, I think this is perhaps more an issue with the dokuwiki cache folder. I manually delete the folder contents, but I guess there is some kind of command to do this programmatically, isn't there? – 2009-05-03, Josef jmeile@hotmail.com
You should be able to purge cache by putting ?purge=true at the end of the URL… http://www.dokuwiki.org/devel:caching#purging_the_cache I found it doesn't always work though, the best way is to delete the contents of the cache directory.
hello, I want to use my DokuWiki installation in two networks -
For usual media files in wiki with syntax
{{playground:1.jpg}}
I haven't problem - they properly displayed in both (internal and Internet) cases. But for flash with this cool flashplayer I have problem - only in one of wiki they displayed properly.
How I can customize this plugin for relative path (I don't want to use name of webserver in path in <flashplayer> brackets, I want that name of webserver will be placed automatically )
I'm really beginner in PHP.
thanks in advance. Sorry, if bad English — Bushroot 2007-09-08 06:47
Playing internal Files too. Like <flashplayer>file=:audio:testfile.mp3</flashplayer> — Markus Bergholz 2008/07/30 10:07Yeah, I second that. The ability to play internal files would be really nice. Maybe it does this already, but I haven't been able figure it out the syntax.Just use the relative path beginning with /_media/ - e.g. if your file is :audio:testfile.mp3 then its path is /_media/audio/testfile.mp3. Maybe you have to add the root directory, if your wiki is not in / (e.h. /wiki/_media/audio/testfile.mp3).
You should waste a little more time explaining how the flashvars should be given. For example, how do you give two flashvars? Do you separate them with commas, semicolons, spaces?
I just found that you have to use ampersnad '&' to separate them, ie:
<flashplayer>file=/path/to/file.flv&showfsbutton=false</flashplayer>