====== videogg plugin ======
---- plugin ----
description: Show Ogg Theora videos in your pages
author : Ludovic Kiefer
email : ludovic *at* skolelinux *dot* fr
type : Syntax
lastupdate : 2010-03-04
compatible : dokuwiki-2009-12-25
depends :
conflicts :
similar :
tags : video ogg theora vorbis html5
downloadurl:
bugtracker :
sourcerepo :
donationurl: http://www.emmaus-forbach.fr/commentaider
----
===== Download and Installation =====
Paste the source code in a file named syntax.php and put it the lib/plugins/videogg directory of your DokuWiki installation.
Source code:
'Ludovic Kiefer',
'email' => 'ludovic _AT_ skolelinux _DOT_ com',
'date' => '2010-03-04',
'name' => 'OGG Video Plugin',
'desc' => 'Show Ogg Theora videos, using the html5 video tag.',
'url' => 'http://www.dokuwiki.org/plugin:videogg',
);
}
function getType() { return 'substition'; }
function getSort() { return 159; }
function connectTo($mode) { $this->Lexer->addSpecialPattern('\{\{videogg>[^}]*\}\}', $mode, 'plugin_videogg'); }
/**
* Handle the match
*/
function handle($match, $state, $pos, &$handler){
$params = substr($match, strlen('{{videogg>'), - strlen('}}') ); // Strip markup
return array($state, explode('|', $params));
}
/**
* Create output
*/
function render($mode, &$renderer, $data) {
if($mode == 'xhtml'){
list($state, $params) = $data;
list($video_url, $video_size) = $params;
if(substr($video_url,-3) != 'ogg' && substr($video_url,-3) != 'ogv') {
$renderer->doc .= 'Erreur: La vidéo doit avoir l\'extention ogv ou ogg.
'.$video_url;
return false;
}
if(is_null($video_size) or ! substr_count ( $video_size , 'x')) {
$width = 200;
$height = 166;
}
else{
$obj_dimensions = explode('x' , $video_size);
$width = $obj_dimensions[0];
$height = $obj_dimensions[1];
}
//$obj = '';
$renderer->doc .= $obj;
return true;
}
return false;
}
}
?>
===== Syntax and Usage =====
This plugin use the new html5