MP4 Video on MediaWiki -


i have mp4 videos have been produced in-house host on our internal mediawiki (1.26.3). can't seem find extension compatible version. doing wrong looking appropriate extension (meaning, there native way display video) or out of luck until 1 of extensions gets updated?

use videoplayer extension (compatible v1.26.3) html5 provider.

to install videoplayer extension follow instructions in https://www.mediawiki.org/wiki/extension:videoplayer :

1) in wiki folder, copy following php code extensions/videoplayer/videoplayer.php (create file if not exist yet):

<?php // see http://www.mediawiki.org/wiki/extension:videoplayer more information.  $wgextensionfunctions[] = 'videoplayer'; $wgextensioncredits['parserhook'][] = array(     'name'          => 'videoplayer',     'description'   => 'display video players youtube, dailymotion, vimeo, google, etc...',     'author'        => 'joachim chauveheid',     'version'       => 1.0  );  function videoplayer() {     global $wgparser;     $wgparser->sethook('video', 'rendervideoplayer'); }  function rendervideoplayer($input, $args) {     $url = array();     $url['allocine']    = 'http://www.allocine.fr/blogvision/%1$s';     $url['blip']        = 'http://blip.tv/play/%1$s';     $url['dailymotion'] = 'http://www.dailymotion.com/swf/%1$s?syndication=112040';     $url['facebook']    = 'http://www.facebook.com/v/%1$';     $url['gametrailers']= 'http://www.gametrailers.com/remote_wrap.php?mid=%$1s';     $url['googlevideo'] = 'http://video.google.com/googleplayer.swf?docid=%1$d';     $url['html5'  ]     = '%1$s';     $url['metacafe']    = 'http://www.metacafe.com/fplayer/%1$d/' . (isset($args['vid']) ? $args['vid'] : '') . '.swf';     $url['myspace']     = 'http://mediaservices.myspace.com/services/media/embed.aspx/m=%1$s';     $url['revver']      = 'http://flash.revver.com/player/1.0/player.swf?mediaid=%1$u';     $url['sevenload']   = 'http://en.sevenload.com/pl/%1$s/%2$ux%3$u/swf';     $url['viddler']     = 'http://www.viddler.com/player/%1$s';     $url['vimeo']       = 'http://www.vimeo.com/moogaloop.swf?clip_id=%1$d&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0';     $url['youku']       = 'http://player.youku.com/player.php/sid/%1$s/.swf';     $url['youtube']     = 'http://www.youtube.com/v/%1$s?fs=%5$u';       $flashvars = array();     $flashvars['revver'] = 'mediaid=%1$u&affiliateid=0';      $type       = isset($args['type'],$url[$args['type']]) ? $args['type'] : 'youtube';     $media_url  = isset($url[$type]) ? $url[$type] : $url['youtube'];     $flash_vars = isset($flashvars[$type]) ? $flashvars[$type] : '';      $input_array = explode('|', htmlspecialchars($input));     $id     = current($input_array);     $width  = (count($input_array) > 1 && is_numeric($input_array[1])) ?     $input_array[1] : 425;     $height = (count($input_array) > 2 && is_numeric($input_array[2])) ? $input_array[2] : 350;     $fullscreen = (isset($args['fullscreen']) ? $args['fullscreen'] : 'true') === 'false' ? false : true;      if(strtolower($type) == 'html5')     {         $output = '<video src="'.$id.'" controls style="width:'.$width.'px;height:'.$height.'px"></video><p style="font-size:80%;padding:0;margin:0;">(right click control movie)</p>';         return $output;     }     else     {         $output = '<object width="%2$u" height="%3$u">'             .' <param name="movie" value="'.$url[$type].'" />'             .' <param name="allowfullscreen" value="%4$s" />'             .' <param name="wmode" value="transparent" />'             .' <embed src="'.$url[$type] . '" type="application/x-shockwave-flash" wmode="transparent"'             .' width="%2$u" height="%3$u" allowfullscreen="%4$s"'                     . ' flashvars="' . $flash_vars . '"></embed></object>';         return sprintf($output,$id,$width,$height,$fullscreen ? 'true' : 'false', (integer)$fullscreen);     } } ?> 

2) add following wiki's localsettings.php:

require_once("$ip/extensions/videoplayer/videoplayer.php"); 

installation can verified through special:version (https://www.mediawiki.org/wiki/special:version)

once videoplayer installed, copy video(s) /resources/assets folder in root directory of mediawiki project , write video tag code mediawiki page editor, using 'html5' provider:

<video type="html5">/mywiki/resources/assets/my-video.mp4</video> 

cheers!


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo