Extension talk:YouTube

Jump to navigation Jump to search

About this board (talkcontribs)

To give the iframe a CSS class you can edit line 158:

return "<iframe class=\"videoframe\" width=\"{$width}\" height=\"{$height}\" src=\"{$url}\" frameborder=\"0\" allowfullscreen></iframe>";

Would this be appropriate to add to the master repo?

Reply to "CSS class"
Stormwatch (talkcontribs)

Is there a way to, using this extension, create a gallery of video thumbnails? (I tried to link to a Wikia page to provide an example of what I want, but the stupid spam filter detected it as spam.)

94rain (talkcontribs)

Try not add https://

Stormwatch (talkcontribs)
94rain (talkcontribs)
Stormwatch (talkcontribs)

Well, you did it with video files from the Commons. What I had in mind, as in my example, is a gallery of embedded YouTube videos. And this, I can't get to work.

Commuter3 (talkcontribs)

You do know that you have to copy the URL then post it in Special:Videos? After the video is put on the wiki, you type in the name of the video and put it in the gallery.

TitusiMW (talkcontribs)


I am looking for exact same use case as described by @Stormwatch. Can you please clarify your comment above?

1/ Is the page Special:Videos created by this YouTube extension? I dont have this extension and I dont have this special page either. Got a bit confused because @94rain said no extension is needed to achieve this capability.

2/ When you add youtube video link to the Special:Videos, it will not upload the video file to my wiki installation, right? I want video files to stay in youtube and not bloat storage in my wiki. If I am understanding you correctly, you are saying that it will simply assign a name to the youtube video and then I can use that name in the thumbnail? Example above uses File:* format to link thumbnails to vides. If it is just the name on my wiki and not actual file, then you would you chnage code below?


3/ Is this all compatible with MW's built feature to link thumbnail to a separate MW page?


What I am trying to do is have a thumbnail gallery of videos. Clicking on thumbnails will take me to another MW page. In that MW page, I would have youtube video embedded at top and have some text descirption at the bottom. I dont want video file upload on my wiki. It needs to stay on youtube.

Any help/pointers, greatly appreciated. Thanks!

Commuter3 (talkcontribs)

Only thumbnails? Save the thumbnail pictures. I can suggest a link:


For video-thumbnail links to MW pages, do this:

VideoThumbnail1.png|Caption|link=Random Page
VideoThumbnail2.png|Caption|link=Random Page
VideoThumbnail2.png|Caption|link=Random Page

The images have to be formatted in a file format like png or jpg.

Reply to "Create a video gallery?" (talkcontribs)

If you get "Video unavailable"; you must send a Referer header, this means not setting Referrer-Policy: no-referrer or another type of policy that would result in no Referer header for the YouTube domain.

Reply to "Video unavailable"

Not showing in Special:Version

ThorstenStaerk (talkcontribs)

After installing it the way you describe, it does not show up in Special:Version. I have mediawiki 1.21 and try loading it with both

wfLoadExtension( 'YouTube' );



Any chance to make it downward-compatible?

Reply to "Not showing in Special:Version"

Error when using the extension as a parameter of a template

Summary by Tosfos

Use #tag parser function

AngeCI (talkcontribs)

I use this in a template:


And the video is not loaded properly. I am sure the video code itself is valid. Can someone tell me how can I fixed it?

Tosfos (talkcontribs)

In case this is still relevant for someone, you'd want to do something like:


See here for more information. (talkcontribs)


Reply to "Error when using the extension as a parameter of a template"

Could be max-width=100% for mobile?

B.Shapoval (talkcontribs)

How to set maximum width in per cent for mobile view?

B.Shapoval (talkcontribs)

I found following solution (to MediaWiki:Mobile.css):

@media screen and (max-width: 750px) {
    iframe {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;

It works with images too, so no additional limitations needed.

Reply to "Could be max-width=100% for mobile?"
Kghbln (talkcontribs)

... between the docu you just copied into the extension's docu page and the docu that was already on that page and still is? @Timeshifter:

Timeshifter (talkcontribs)

It has some additional info not talked about in the previous doc page. Plus it explains some things better or more in depth. Can't hurt to leave it.

Kghbln (talkcontribs)

I am not sure why you did not just add the missing information to the existing one. To me this page looks like a confusing concatenation of duplicate information. I am not able to determine the difference. :( I am utterly sure this can be done better and yes, I know that this is an bigger effort.

Timeshifter (talkcontribs)

I put it in a show/hide box so it is not such a distraction. That way people can incorporate various parts into the main text of the doc page.

Reply to "What is the difference ..."
There are no older topics