Comments on EmbedVideo Extension
Hi Mark,
Thanks for tip - and good catch!
I've updated the source to allow '-' characters anywhere in Google Video id's (who knows if they might sprout up elsewhere).
Unfortunately, creating the "bad id" filters is a bunch of guesswork as these services don't publish a nice inclusive list of valid characters (at least I haven't found any).
Thanks again,
--Jimbojw 07:18, 8 June 2007 (MST)
good
--sskim 00:02, 14 June 2007 (MST)
Love it! Is there any way to add the new Filefront video to this? It is the only one I use that is not part of your extension :)
--Paccoco 08:25, 16 June 2007 (MST)
Hi Paccoco,
Of course you can add new sites! As per the Configuration section of the extension home page, you can add any new services you like.
All you have to do is figure out the URL needed to access the flash movies and update your LocalSettings.php file appropriately. Good luck!
--Jimbojw 09:29, 16 June 2007 (MST)
This not a big problem, just a minor fix to keep my logs cleaner.
I was getting in my apache logs: Undefined index: id_pattern in EmbedVideo.php on line 155
changed line 155 to:
$idpattern = (!empty ($service['id_pattern'])?$service['id_pattern']:'%[^A-Za-z0-9_\\-]%');
and the warning goes away.
--Brad Wyman 10:20, 18 June 2007 (MST)
Hi, I like this Extension. Unfortunately I have some problems with google videos with a minus sign as first character. I have seen that there is a solution for this and it should work, but it doesn't. What can I do?
Thanks
--Sascha Ballach 03:19, 22 June 2007 (MST)
Hi! My Question goes in same direction as Saschas! How do I find out the ID of a Video? Is -5625548517080716077 the ID of: http://video.google.de/videoplay?docid=-5625548517080716077&q=robbins&total=3728&start=0&num=10&so=0&type=search&plindex=7 but this does not work... I had the same difficulties with youtube ID's.
--Carsten 05:14, 22 June 2007 (MST)
Hi Carsten,
That ID appears correct, however I notice that you're accessing video.google.de, not video.google.com. By default, video.google.com is the base for Google Video urls.
It's possible to configure the URLs withing your LocalSettings.php file - see the EmbedVideo Extension page for an example.
Good luck!
--Jimbojw 23:11, 25 June 2007 (MST)
Hi Sascha,
If you re-download the extension, I think you'll find that the dash characters should now be accepted for Google Videos. Sorry for the confusion. :(
Thanks!
--Jimbojw 23:28, 25 June 2007 (MST)
Thanks, if you find anything pleas mail me: nicolas.alen@elserver.com.
--Nicolás 23:10, 1 July 2007 (MST)
Sorry, the html code wasn't escaped. I mean: [p][br /][p] right before the [object] with the movie.
Thanks.
PS: If you find anything, could you mail me? nicolas dot alen at elserver dot com. Thanks!
--Nicolás 23:13, 1 July 2007 (MST)
is there any way to extend this for blip.tv? I tried but it doesn't seem to work, and I don't have too much experience with mediawiki templates. thanks for the help
--dave morris 13:23, 31 July 2007 (MST)
I know finding the URL for other services is left as an exercise, but does anyone happen to know where I can get some help with how to figure that out? I'm trying to add a private Ning network without success. I've tried deconstructing other URLs from the EmbedVideo source but have not been able to figure it out. I like this extension better than the others and would prefer to use it.
--Jim Sweet 07:52, 26 August 2007 (MST)
Is there any way to include Stage6 (divx) support to this extension?
--Andrej 21:28, 17 September 2007 (MST)
Hi dave morris,
From what I can tell, blip.tv does not have a nice URL-based mechanism for embedding their videos. In fact, their "share" example HTML requires embedding javascript to get the job done.
So unfortunately, I don't think there's a good way to extend EmbedVideo to support blip.tv. On the other hand, it shouldn't be too hard to create a blip.tv extension if one is really needed.
Good luck!
--Jimbojw 10:08, 18 September 2007 (MST)
Hi there Jimbojw
Thank you very much for supplying this extension to the community. :)
The extension works perfectly although I would love to be able to play http://stage6.divx.com/ videos so that I can present the videos that go with my game guides for the pc game Sacred. I've put:
require_once('extensions/EmbedVideo.php'); $wgEmbedVideoServiceList['divx'] = array( 'url' => 'http://video.stage6.com/$1/.divx' );
in my LocalSettings.php and in the wiki page I put:
{{#ev:divx|1651136}}
Sadly, it doesn't work at all...
Can you shed any light on the matter? I'm certain I've followed the instructions correctly. The things I think could be causing a problem is the period at the end of the url "/.dvx" or that the "$1" is not at the end of the url...
Help!
--Schot 22:51, 25 September 2007 (MST)
Hi Schot,
At this time, EmbedVideo targets Adobe Flash based services only. Since stage6 uses a divx plugin, there's no easy way to retrofit it into EmbedVideo at this time.
However, it would be relatively easy to use the embed clause from stage6's videos and turn it into a suitable extension. To do so would require a bit of coding (mostly copy-paste). Good luck!
--Jim R. Wilson 16:23, 26 September 2007 (MST)
FunnyOrDie, Google Video and Dailymotion not working...
Great extension!
--Scott 15:08, 27 September 2007 (MST)
Hey Jonbojw,
If I wanted to link to a (formerly) Macromedia Breeze presentation how would I script it in the EmbedVideo.php page.
I tried this:
'breeze' => array( 'url'=>'http://www.radoncelearning.com/xxxx/xxxx/file=' )
and
{{#ev:breeze|index.htm}}
as well as a few other variations but didn't get it to work.
Any clues? BTW the Breeze presentation is a .swf file embedded in a html file
Thanks,
Scott
--Scott 16:27, 27 September 2007 (MST)
Ah thanx for the starter info Jimbojw. :)
I'm really completely new to this but I don't mind getting my hands dirty. I'll give it a try. Is there any reading material/site you could recommend to me in order to help me make a divx extension?
Thanx again!
Schot
--Schot 03:00, 28 September 2007 (MST)
Hi Scott,
You're right about FunnyOrDie - it's not working currently. I presume they've changed their format in some breaking way - I'll have to address it when I get some time.
Regarding Breeze, I'm not sure why it's not working. Even if you specify the URL incorrectly, you should at least see something other than the error message.
--Jimbojw 09:24, 28 September 2007 (MST)
Hi Schot,
With respect to creating a new extension for divx, I'd suggest doing the following:
And that should be about it - good luck!
--Jimbojw 09:28, 28 September 2007 (MST)
Oh wow!
You just made my day Jimbo, haha. Using your youtube extension I have completed a Stage6 extension. Woohoo! My first contribution to the community. :D
How do I put code inside a codebox so I can post it here?! Haha.
--Schot 17:32, 28 September 2007 (MST)
Ah now I know how to do it, haha. Everything to do with a wiki is so new to me. *dizzy*
Andrej, you should find this useful. :)
Now all I need to do is to tweak this code a bit more so that users can control the size of the player so as to accomodate different video sizes and presentations... I think I'll not sleep tonight. :D
application/x-httpd-php DivxTag.php
PHP script text
<?php //{{MediaWikiExtension}}<source lang="php">
/*
* YouTubeTag.php - Provides youtube tag for embedding a YouTube video into a page.
* @author Jim R. Wilson
* @version 0.1
* @copyright Copyright (C) 2007 Jim R. Wilson
* @license The MIT License - http://www.opensource.org/licenses/mit-license.php
* -----------------------------------------------------------------------
* Description:
* This is a MediaWiki extension which adds an additional tag, <divx>, for embedding
* Divx videos into wiki articles.
* Requirements:
* MediaWiki 1.6.x, 1.8.x, 1.9.x or higher
* PHP 4.x, 5.x or higher
* Installation:
* 1. Drop this script (DivxTag.php) in $IP/extensions
* Note: $IP is your MediaWiki install dir.
* 2. Enable the extension by adding this line to your LocalSettings.php:
* require_once('extensions/DivxTag.php');
* Usage:
* Once installed, you may utilize DivxTag by placing the <divx> tag in an
* article's text:
* <divx v="aStage6Id" />
* -----------------------------------------------------------------------
* Copyright (c) 2007 Jim R. Wilson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
* -----------------------------------------------------------------------
*/
# Confirm MW environment
if (defined('MEDIAWIKI')) {
# Credits
$wgExtensionCredits['parserhook'][] = array(
'name'=>'DivxTag',
'author'=>'Jim Wilson (wilson.jim.r<at>gmail.com)',
'url'=>'http://jimbojw.com/wiki/index.php?title=YouTubeTag',
'description'=>'Provides youtube tag embedding videos into a page.',
'version'=>'0.1'
);
# Register Extension initializer
$wgExtensionFunctions[] = "wfDivxTagExtension";
# Extension initializer
function wfDivxTagExtension() {
global $wgParser, $wgMessageCache;
$wgParser->setHook( "Divx", "renderDivxTag" );
$wgMessageCache->addMessage('divxtag-bad-id', 'Invalid Divx video ID supplied: [$1]');
}
/**
* Callback function for embedding video.
* @param String $input Text between open and close tags - should always be empty or null.
* @param Array $params Array of tag attributes.
* @param Parser $parser Instance of Parser performing the parse.
*/
function renderDivxTag( $input, $params, &$parser ) {
# Check for 'v' parameter and ensure it has a valid value
$v = htmlspecialchars($params['v']);
if ($v==null || preg_match('%[^A-Za-z0-9_\\-]%',$v)) {
return '<div class="errorbox">'.wfMsgForContent('divxtag-bad-id', $v).'</div>';
}
# Build URL and output embedded divx object
$url = "http://video.stage6.com/$v/.divx";
return
'<object codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab" height="384" width="512" '.
'classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616">'.
'<param name="autoplay" value="false">'.
'<param name="src" value="'.$url.'" />'.
'<param name="custommode" value="Stage6" />'.
'<param name="wmode" value="transparent"></param>'.
'<embed type="video/divx" src="'.$url.'" '.
'pluginspage="http://go.divx.com/plugin/download/" showpostplaybackad="false" '.
'custommode="Stage6" autoplay="false" height="384" width="512" />'.
'</object>';
}
} # Closing MW Environment wrapper
//</source>
--Schot 18:28, 28 September 2007 (MST)
It would be great if dotSUB were to be added to this sometime in the future. It's a great solution for videos with subtitles translated by viewers to many languages.
--Jason 21:58, 30 September 2007 (MST)
This extension seems to works well. However, it cannot play videos uploaded to a MediaWiki site, as one cannot link directly to these movies. Any solution would be greatly appreciated.
--Frank 06:31, 4 November 2007 (MST)
Hi Frank,
I believe media support is planned for an upcoming major MediaWiki release. It may even already be available in the latest pre-release code. Good luck!
--Jimbojw 13:47, 4 November 2007 (MST)
Hi! Thanks for this lovely feature.
Embedding videos from the 'safe' sites works great for me but not when I try to add new ones. I've added the following code into LocalSettings.php. Can you tell me if it is done correctly?
Best Regards, Andreas
require_once('extensions/EmbedVideo.php'); $wgEmbedVideoServiceList['gametrailers'] = array( 'url' => 'http://www.gametrailers.com/player/$1' );
--Andreas Wieslander 09:53, 11 December 2007 (MST)
I was recently asked how to make youtube videos autoplay. The easiest way, IMO, is to add this to your LocalSettings.php:
$wgEmbedVideoServiceList['ytauto'] = array( 'url' => 'http://www.youtube.com/v/$1&autoplay=1' );
Then, access 'ytauto' instead of 'youtube' like this:
{{#ev:ytauto|dMH0bHeiRNg}}
--Jimbojw 07:38, 3 January 2008 (MST)
Thanks for the great extension! I just added it to my wiki and it seems to be working perfectly!
Best, Brian
--brian 11:25, 4 February 2008 (MST)
How do I find the code to use for the daily motion on their site? nothing seems to match in their embbedded code that is in the one. where do I find the 7tE9MbSfWo9YaeNRP ?
--speedingslug 09:08, 13 March 2008 (MST)
Hey, I added Blip.tv to the extension with this code:
'blip' => array( 'url' => 'http://blip.tv/play/$1' )
You can see it work here: http://pawsitivevybe.com/discdogopedia
Thanks for the great plug in.
I've literally been waiting for years for this.
Cheers, Ron Watson http://k9disc.com http://pawsitivevybe.com http://discdogseminars.com
--Ron Watson 23:56, 13 March 2008 (MST)
Hi Ron,
I'm glad you like it :)
I was tired of other video embedding tags which:
Thanks a bunch for figuring out blip.tv - I looked at blip prior to launching the seminal version of EmbedVideo, but at the time getting direct embeddable links required a developer api key (lame).
Looks like they must have opened it up some. When I get some time, I'll incorporate blip into the extension directly, and fix some of the other ones (I'm fairly certain that my FunnyOrDie support is broken).
Unfortunately I've been swamped at work - even my blog has been woefully neglected as late.
Anyway, thanks again for contributing :)
--Jimbojw 20:42, 14 March 2008 (MST)
I seem to have a problem installing the extension, where the entire Wiki disappears, and all it shows is the code for the extension... I'm using mambowiki in Joomla btw. I believe I've followed the instructions correctly.
--Karl 08:18, 20 March 2008 (MST)
Ok, I downloaded the file as an html first. Now I downloaded the correct file, renamed it to EmbedVideo.php, uploaded it to the extensions directory, and added:
require_once('extensions/EmbedVideo.php');
to localsettings.php. When I do this, my Wiki disappears (blank page). If I remove:
require_once('extensions/EmbedVideo.php');
It comes back... confused :(
--Karl 08:30, 20 March 2008 (MST)
Karl,
Anytime you get a blank page, 99% of the time, that means that a Fatal Error has occurred and your PHP is configured not to display them.
The first thing you should do is figure out how to set your error logging up higher. This can be done from your LocalSettings.php file via PHP's error_reporting() function.
Once that's done, the two most likely causes for error are:
If it turns out that it's a permissions problem, on a *nix based system, you should be able to chmod your file to have the proper permissions.
If you're using Windows, it's a bit more complicated, and unfortunately I don't remember all the steps. If I recall, it has something to do with adding the webserver's user to the access control list. :/
Good luck!
--Jimbojw 01:08, 22 March 2008 (MST)
Hey Jimbo, I think Dailymotion is down too. Or I just couldn't locate the filename.
Blip has opened up considerably since the last upgrade.
Thanks again.
Can't wait for the update.
Cheers, Ron
--Ron Watson 20:30, 24 March 2008 (MST)
thanks for your great code. do you know how can i add a teachertube video in your code? www.teachertube.com
thanks.
--mahdi 10:00, 6 April 2008 (MST)
Hi there.. i think your software is great.. but i have one question though. Is there a way to embed LOCAL videos stored on my server to my MediaWiki.. or does it only work with services such as Youtube?
--Eric 08:07, 12 May 2008 (MST)
Can you add facebook videos... Example: http://www.facebook.com/video/video.php?v=01234567891
--will 13:44, 1 June 2008 (MST)
Thanks for the great extension!
Question: how do I specify the location of the video on the page? (for example on the right side)
thanks again
--Tobias 08:44, 7 July 2008 (MST)
Excellent! Installs quick and your embedding video. Great work!
--DaiMoGui 22:42, 15 July 2008 (MST)
Great extension! What is the best method for creating a video gallery like you can do with images in Mediawiki.
For example, if I would like to have, say, a 3x3 video array - how do I avoid all the newlines/new paragraphs or whatever stops me from doing this?
--Ken 12:04, 4 August 2008 (MST)
Works great, just what I was after!
Slight problem (easy enough to fix), some google videos have their docId beginning with a - (minus) sign, but if you try to put that in you get the received bad id error. It's easy enough to fix by adding a - to the id_pattern in EmbedVideo.php.
--Mark Bowden 18:03, 7 June 2007 (MST)