扩展:YouTube

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:YouTube and the translation is 52% complete.
Other languages:
English • ‎Esperanto • ‎中文 • ‎日本語 • ‎한국어
MediaWiki扩展手册
OOjs UI icon advanced.svg
YouTube
发布状态: 稳定版
实现 标签 , 媒体
描述 允许嵌入YouTube和Google视频电影,Archive.org音频和视频,WeGame和Gametrailers视频,Tangler论坛和GoGreenTube视频。
作者 Przemek Piotrowski
最新版本 1.9.3 (2018-10-13)
MediaWiki 1.33+
数据庫更新
许可协议 GNU通用公眾授權條款2.0 or later
下载
例子 Any ShoutWiki site
翻译YouTube扩展如果在translatewiki.net可用
检查使用和版本矩阵。
Vagrant角色 youtube


YouTube扩展允许用户嵌入YouTube和Google视频电影,Archive.org音频和视频,WeGame和Gametrailers视频,Tangler论坛和GoGreenTube视频。


最初由Wikia 制作,但Wikia现在不再使用此视频扩展。

安装

  • 下载文件,并将其放置在您extensions/文件夹中的YouTube目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'YouTube' );
    
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

用法

要嵌入YouTube视频:

<youtube>foo</youtube>

其中foo是来自网址的视频ID。 即如果视频的URL是https://www.youtube.com/watch?v=VyBSS48E4xI,那么嵌入代码将是: <youtube>VyBSS48E4xI</youtube>

其他支持的视频服务

See ShoutWiki's help page on using the YouTube extension for more information, such as using alternate, non-YouTube providers to embed content.

YouTube扩展程序还允许嵌入来自这些服务的视频:

Google视频 <gvideo>
Archive.org视频 <aovideo>
WeGame <wegame>
Tangler论坛 <tangler>
Gametrailers <gtrailer>
Nicovideo <nicovideo>
GoGreenTube <ggtube>

设置宽度和高度

示例:

<youtube width="200" height="120">CCz1kmfqL7g</youtube>

您可以更改视频框的宽度和高度

  • 宽度由width = "xxx"控制,其中xxx是像素数。 默认值为640像素。
  • 高度以相同的方式控制,height = "xxx"。 默认值为385像素。

请参阅Wikia关于此扩展的旧帮助页面。 它解释了更多细节。 Here is a link to the last version of it before it was blanked and redirected to the new video embed tool page on Wikia.

旧Wikia帮助页面

See the Wikia help page on April 11, 2018 before it was redirected to the new video embed tool on Wikia.

That Wikia help page is not on Archive.org, so it is copied below in case Wikia deletes the old page altogether. Wikia licenses their material under CC BY-SA. See Wikia licensing page.

旧Wikia帮助页面 -

This page documents how to use the YouTube video extension, an older video extension. Videos added using the YouTube tag are automatically converted to file pages so as to help reduce page load time and improve video data tracking. A few exceptions exist and are listed below.

Step-by-step

Using the YouTube extension

To add a video using the YouTube extension, you need the ID code for the video. The string of letters and numbers after "v=" in the URL is the ID code. So for the URL: https://www.youtube.com/watch?v=CCz1kmfqL7g the ID code would be CCz1kmfqL7g.

YouTube videos are embedded using two tags, with the ID code for the video you want to show between them:

<youtube>ID code</youtube>

"ID code" is the code from the YouTube URL. So in this example, you would use:

<youtube>CCz1kmfqL7g</youtube>

You can change the width and height of the video box

  • Width is controlled with width="xxx", where xxx is the number of pixels. The default is 640 pixels.
  • Height is controlled in the same way with height="xxx". 默认值为385像素。

So the example from above could be:

<youtube width="200" height="120">CCz1kmfqL7g</youtube>

转换

Once the page with the YouTube tag is saved the tag will be converted to a file page, pulling the name from the YouTube video name. Only the width is converted, except if the height is designed for use in an audio player. Attribution on the file page is attributed to the user who added the YouTube tag.

This happens in all circumstances except when the video play bar is smaller than 30 pixels in height. This will render a usable audio player on mobile devices and some desktop browsers (excluding Google Chrome).