Extension talk:YouTube (Iubito)

how do I add a link for the youTube in the navigation menu
Well ... I followed your instructions and there weren't any errors. However, how do I add a link for the youTube in the navigation menu at my wiki so my members know it even exists?

Full URL should also work
Is there a way users can also use the full URL of a Youtube video? People are not used to deleting part of a YouTube URL. The way to do this could be:
 * IF $input string starts with "http:", THEN use this as the embed code directly - ELSE (do as you have done).--Matt57 05:24, 21 October 2006 (UTC)

More Parameters
If you want to add some parameters like

ID|width|height|style

use the following code instead of the one provided before (just replace this one procedure):

# The callback function for converting the input text to HTML output function renderYouTube($input) { $params = explode ("|", $input); $id = $params[0]; $width = 425; $height = 350; $addStyle = ''; if (count($params) > 1) { $width = $params[1]; if (count($params) > 2) { $height = $params[2]; if (count($params) > 3) { $addStyle = ' style="'. $params[3] . '"'; }             }           }        $output=''               .'' .'  ' .' ';        return $output; }

Anywhere on your page, you just type the following information:

VideoID

Where the "VideoID" is the code follows after "watch?v=" In the following case, it is WZpeeRSk-0A url http://www.youtube.com/watch?v=WZpeeRSk-0A

Good-luck!

--Kohyin 23:16, 24 January 2007 (UTC)

YouTube opens up in new window
This works great embedding the YouTube video except when hitting the PLAY arrow, a new window opens up to the full YouTube page versus playing the video embedded in the page as your sample does. Am I doing something wrong or has something changed?

Thanks! -Larry

FYI, I copied the .php codes from the article page not from the discussion page, and I use the simplified sintax as I mentioned above. My videos are running as they should.--Kohyin 07:35, 30 January 2007 (UTC)


 * If you click on the big "play" button in the middle of the video, it works OK. I also noticed that if you click on the small "play" button on bottom/left, it opens a new page. This bottom/left button works well to pause/replay after starting the video with the big middle button. --82.255.133.227 06:54, 17 May 2007 (UTC)

Revvr
Would it be possible to modify this extension, to play videos from the revver site?--Rovo 22:31, 14 February 2007 (UTC)

Tabe of Contents broken by this extension
Hi all...anyone noticed that if you use this extension in a page that has a Table of Contents that the section link to the one below the section that has the video in it actually ends up going to the section with the video in it? (clear as mud?) The work around is to a a single character after the video. ChuckMcB
 * That's not very clear. I didn't noticed any problem on my wiki. Can you explain better ? --82.255.133.227 06:54, 17 May 2007 (UTC)

XSS Vulnerability Example
For an example of how this extension is vulnerable to XSS attacks, consider the following: " id="deleteme">  var dm=document.getElementById('deleteme'); dm.parentNode.removeChild(dm); alert('XSS Attack Here!'); <embed style="display:none --Jimbojw 16:31, 27 March 2007 (UTC)
 * This is now fixed !
 * Thanks for the concrete example of what is a XSS vulnerability. I've heard this word before but can't get an example of what it is.
 * --Iubito 06:55, 17 May 2007 (UTC)
 * That's why the warning template links to the wikipedia article that explains it... -- Duesentrieb ⇌ 00:06, 18 May 2007 (UTC)


 * The fix was bogus -- validation was done against a variable that doesn't exist, and never failed. Fixed properly with validation on the right variable plus proper, safe by default output. Note similar fix to Extension:YouTube (emijrp). Thanks to Andy Webber for reporting the bug remaining in both. --brion 18:44, 9 July 2008 (UTC)

Sizing
Would it be possible to change the size of the youtube video with a code? I am unable to find a way to do this thusfar and it would immensely useful. --Entropy 16:14, 6 July 2007 (UTC)

Parameters not documented
This isn't documented very well.

Of the 4 parameters, ID, width, height and Style. I don't know what Style does.

Can someone explain?

Judging from I think 'style' is the Flash version required to be installed in the persons PC?


 * Also did you know if you add '&autoplay=1' after the ID then it autoplays? :-))

--Quatermass 18:47, 2 October 2007 (UTC)

YouTube button
Is there a way to add a YouTube-button to the other editing buttons (Such as "Bold text", "External link" and "Horizontal line") that automaticly creates the text " Insert YouTube-URL here " in the editor?

/Abbedabb 15:17, 25 August 2008 (UTC)

(better late than never? maybe...) you want to read http://www.mediawiki.org/wiki/Customizing_edit_toolbar#How_do_I_add_more_buttons_on_the_edit_page.3F it explains how to add edit buttons to the edit toolbar. arod 17 March 2010

failles ?
le code n'a plus de failles ?

W3 Validation
Any plans to make this code valid W3? specifically, see http://www.alistapart.com/articles/flashsatay about how to create flash without using the non-standard "embed" tag.

Thanks, arod, 2010-3-16

Extension doesn't seem to work well with templates.
This is a template I have on my wiki: ""

I type in (goes to this video) and get the "bad video ID!" message. After some poking around, I type in 8HA_eJUlOKo, save the page and re-edit, and find that the "" inside the tag didn't convert!

Is there something special I need to do in order to get the template to work?

SPECIAL NOTE: The youtube: bit is an interwiki link I made for my wiki. 4.249.183.235 22:01, 2 September 2010 (UTC)
 * UPDATE: NEVER MIND. I used Extension:EmbedVideo in conjunction with this extension to make it work. 4.249.183.41 23:03, 5 December 2010 (UTC)

Embedded video causes paragraph breaks to disappear in some cases
In some cases an embedded video with this extension causes paragraph breaks to disappear. Blank lines no longer work in creating paragraphs.

See discussion and hack fix:
 * http://community.wikia.com/wiki/Forum:Paragraphs_have_stopped_working

MediaWiki version and extensions being used:
 * http://cannabis.wikia.com/wiki/Special:Version --Timeshifter (talk) 03:16, 4 April 2012 (UTC)