Stylesheet style.css not found, please contact the developer of "arctic" template.

Blip.tv-PlugIn

Mein zweites eigenes PlugIn für das DokuWiki. Es bindet Videos von Blip.tv in die Wiki-Seiten ein und bedient sich ebenfalls großzügig des Codes des YouTube-Video-PlugIns von Ikuo Obataya, den ich für diese Zwecke angepaßt habe. Ich bin nicht gerade ein begeisterter PHP-Programmier. Also, obwohl ich glaube, alles verstanden zu haben, was ich da gemacht habe, nutzt ihr das PlugIn natürlich auf Euer eigenes Risiko. :!:

Beispiel

standard:618981

Dog-Agility at it's Best: Monika Lux mit Maya

Syntax

{{blip>standard:VIDEO_ID}}

{{blip>medium:VIDEO_ID}}

{{blip>wide:VIDEO_ID}}

Blip.tv skaliert die Filmgrößen nicht wirklich selber, vor allem nicht, wenn man eigene Flash-Dateien hochlädt. Daher sind die Bezeichnungen standard, medium und wide sehr von meinen persönlichen Vorlieben abhängig, im Zweifelsfall müßt Ihr für Eure Zwecke die Größen im Quelltext anpassen. Es bedeuten:

standard: Der Film wird in einer Größe von 400 x 300 Pixeln gezeigt (das ist die Größe, auf der ich normalerweise Flash-Filme konvertiere).

medium: Ist wie immer für Flash-Filme in der Größe 320 x 240 Pixeln gedacht. Manche Digiknipsen liefern kein größeres Bild und es wäre daher sinnlos, diese Videos aufzublasen.

wide: Das ist eine Einstellung für 16:9-Filme mit einer Weite von ( 25x16= ) 400 und einer Höhe von ( 25x9= ) 225 Pixeln.

Die 30 Pixel für die Steuerleiste werden vom PlugIn automatisch hinzugerechnet.

VIDEO_ID

Die VIDEO_ID ist bei Blip.tv leider etwas versteckt. Am einfachsten findet Ihr sie, wenn Ihr bei »Share« → »Copy & Paste« → »WordPress.com« auswählt. Es ist die dort »posts_id« genannte Ziffer. Achtet darauf, daß Ihr tatsächlich die FLV-Datei gerade abspielt und nicht irgend etwas anderes.

Quellcode

<?php
/**
* Plugin Sevenload: Create Blip.tv video link and object from ID.
*
* @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author     Joerg Kantel <joerg@kantel.de>
*			  Based on the YouTube PlugIn written by Ikuo Obataya
*			  <http://wiki.symplus.co.jp/computer/en/youtube_plugin>
*/
 
// must be run within Dokuwiki
if(!defined('DOKU_INC')) die();
 
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_INC.'lib/plugins/syntax.php');
 
/**
* All DokuWiki plugins to extend the parser/rendering mechanism
* need to inherit from this class
*/
class syntax_plugin_blip extends DokuWiki_Syntax_Plugin {
	/**
	* return some info
	*/
	function getInfo(){
		return array(
		'author' => 'J. Kantel',
		'email'  => 'joerg@kantel.de',
		'date'   => '2008-01-27',
		'name'   => 'Blip.tv Plugin',
		'desc'   => 'Blip.tv video object',
		'url'    => 'http://www.cognitiones.de/',
		);
	}
	function getType(){ return 'substition'; }
	function getSort(){ return 159; }
	function connectTo($mode) { $this->Lexer->addSpecialPattern('\{\{blip>[^}]*\}\}',$mode,'plugin_blip'); }
 
	/**
	* Handle the match
	*/
	function handle($match, $state, $pos, &$handler){
		$match = substr($match,7,-2); // Strip markup
		return array($state,explode(':',$match));
	}	
	/**
	* Create output
	*/
	function render($mode, &$renderer, $data) {
		if($mode == 'xhtml'){
			list($state, $match) = $data;
			list($disptype,$id) = $match;
			if ($disptype=='standard'){
				$obj = '<object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&file=http%3A//blip.tv/rss/flash/'.$id.'&feedurl=http%3A//kantel.blip.tv/rss/&autostart=false&brandname=Der%20Schockwellenreiter&brandlink=http%3A//kantel.blip.tv/" width="400" height="330" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&file=http%3A//blip.tv/rss/flash/'.$id.'&feedurl=http%3A//kantel.blip.tv/rss/&autostart=false&brandname=Der%20Schockwellenreiter&brandlink=http%3A//kantel.blip.tv/" /><param name="quality" value="best" /></object>';
				$renderer->doc .= $obj;
				}
			elseif($disptype=='medium'){
				$obj = '<object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&file=http%3A//blip.tv/rss/flash/'.$id.'&feedurl=http%3A//kantel.blip.tv/rss/&autostart=false&brandname=Der%20Schockwellenreiter&brandlink=http%3A//kantel.blip.tv/" width="320" height="270" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&file=http%3A//blip.tv/rss/flash/'.$id.'&feedurl=http%3A//kantel.blip.tv/rss/&autostart=false&brandname=Der%20Schockwellenreiter&brandlink=http%3A//kantel.blip.tv/" /><param name="quality" value="best" /></object>';
				$renderer->doc .= $obj;
				}
			elseif($disptype=='wide'){
				$obj = '<object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&file=http%3A//blip.tv/rss/flash/'.$id.'&feedurl=http%3A//kantel.blip.tv/rss/&autostart=false&brandname=Der%20Schockwellenreiter&brandlink=http%3A//kantel.blip.tv/" width="400" height="255" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&file=http%3A//blip.tv/rss/flash/'.$id.'&feedurl=http%3A//kantel.blip.tv/rss/&autostart=false&brandname=Der%20Schockwellenreiter&brandlink=http%3A//kantel.blip.tv/" /><param name="quality" value="best" /></object>';
				$renderer->doc .= $obj;
				}
			else{
				$renderer->doc .="??";
			} 
			return true;
		}
		return false;
	}
}
?>

Installation

Den Quellcode in eine Datei kopieren, die Ihr syntax.php nennt. Dann legt bitte einen Ordner blip im Verzeichnis lib/plugins Eurer Doku-Wiki-Installation an und kopiert die syntax.php dort hinein. Und schon könnt Ihr mit Blip.tv Euren eigenen Fernsehsender hochziehen.

Verwandte Seiten

blip.tv-plugin.txt · Last modified: 2008/08/14 13:29 by 127.0.0.1
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0