扩展:嵌入かんにゅうしき视频

From mediawiki.org
This page is a translated version of the page Extension:EmbedVideo and the translation is 75% complete.
A maintained fork of this extension is available, which focuses on privacy. Note, however, that only a subset of services is supported.
MediaWiki扩展しゅさつ
EmbedVideo
发行じょう态: さい維護
实现 解析かいせき函数かんすう
描述 添加てんかいち个名为 #ev てき分析ぶんせき函数かんすうよう于嵌入来いりき流行りゅうこう视频どもとおるふく务的视频剪辑
作者さくしゃ
最新さいしん版本はんぽん 3.4.0 (2020-10-14)
MediaWiki 1.29+
PHP 7.0+
Composer starcitizenwiki/embedvideo
许可协议 MIT授權じょう
した
しめせれい Gamepedia Help Wiki
  • $wgEmbedVideoEnableVideoHandler
  • $wgFFProbeLocation
  • $wgEmbedVideoUseEmbedStyleForLocalVideos
  • $wgEmbedVideoEnableAudioHandler
  • $wgEmbedVideoLazyLoadLocalVideos
  • $wgEmbedVideoRequireConsent
  • $wgEmbedVideoAddFileExtensions
  • $wgEmbedVideoShowPrivacyNotice
  • $wgEmbedVideoMaxWidth
  • $wgEmbedVideoFetchExternalThumbnails
  • $wgEmbedVideoMinWidth
  • $wgEmbedVideoDefaultWidth
  • $wgEmbedVideoEnabledServices
せいざい使用しようてきおおやけ开wikiすう 7,623 (Ranked 21st)
こぼし译EmbedVideo扩展
Vagrantかくしょく embedvideo

EmbedVideo 扩展添加てんかりょういち个名为 #ev てき解析かいせき函数かんすうよう于嵌入来いりき种语げん国家こっか/地区ちくてきちょう过 24 种流行りゅうこう视频どもとおるふく务的视频剪辑。 它还添加てんかりょう视频和音わおん媒体ばいたい处理ほどじょ,以支持しじはた标准てき [[File:Example.mp4]] ぶんけん链接转换为嵌入かんにゅうしき HTML5 ‎<video> ‎<audio> 标记。

项目くび
GitLabじょうてきぶん
みなもとだい
ざいGitLabじょうてきみなもとだい
ほどじょ错误
GitLab てき问题
许可协议
EmbedVideoざいThe MIT Licenseしも发布。
As of the 2.x series the EmbedVideo extension has a new maintainer and an entirely rewritten code base. It retains backwards compatibility with EmbedVideo 1.0 and EmbedVideoPlus.


用法ようほう

媒体ばいたい处理ほどじょ

对于ほん地上ちじょう传的内容ないようはた其显しめせざい页面じょうてき过程あずか图像しょうどうSee the image syntax documentation for complete reference on this feature.

This example would display a video in page using a HTML5 ‎<video> tag.

[[File:Example.mp4]]

To specify the start and end timestamps in the media use the start and end parameters. The timestamp can be formatted as one of: ss, :ss, mm:ss, hh:mm:ss, or dd:hh:mm:ss.

[[File:Example.mp4|start=2|end=6]]

标签

The EmbedVideo parser function expects to be called in any of the following ways:

<span id="#ev_—_Classic_parser_tag">

#ev — 经典解析かいせき标签

  • {{#ev:service|id}}
  • {{#ev:service|id|dimensions}}
  • {{#ev:service|id|dimensions|alignment}}
  • {{#ev:service|id|dimensions|alignment|description}}
  • {{#ev:service|id|dimensions|alignment|description|container}}
  • {{#ev:service|id|dimensions|alignment|description|container|urlargs}}
  • {{#ev:service|id|dimensions|alignment|description|container|urlargs|autoresize}}
  • {{#ev:service|id|dimensions|alignment|description|container|urlargs|autoresize|valignment}}

However, if needed optional arguments may be left blank by not putting anything between the pipes:

  • {{#ev:service|id|||description}}

<span id="#evt_—_Parser_tag_for_templates">

#evtばんてき解析かいせき标签

The #evt parser tag allows for key=value pairs which allows for easier templating and readability.

{{#evt:
service=youtube
|id=https://www.youtube.com/watch?v=eAORm-8b1Eg
|alignment=right
}}

<span id="#evu_—_Parser_tag_for_URLs">

#evu — URL てき解析かいせき标记

The #evu parser tag is like the #evt tag, but its first parameter is a URL that will be parsed to determine the service automatically.

{{#evu:https://www.youtube.com/watch?v=eAORm-8b1Eg
|alignment=right
}}

<span id="‎<embedvideo>_—_Tag_hook">

‎<embedvideo> — 标签钩子

视频以用‎<embedvideo>...‎</embedvideo>てき标签钩子轻松嵌入かんにゅう。 ID/URLさく为标记之间的输入,まいりすう以作为标记参すう添加てんか

<embedvideo service="youtube">https://www.youtube.com/watch?v=eAORm-8b1Eg</embedvideo>

あるもの,您也使用しようふく务idさく为标记(かり设另一个扩展尚未使用此标记)。

<youtube>https://www.youtube.com/watch?v=eAORm-8b1Eg</youtube>

解析かいせき标记てき属性ぞくせい

属性ぞくせい 描述 必需ひつじゅ? だま
service="(请参阅下めんてき支持しじふく务。)" ようよびさけべてき视频ふく务。 Required
id="[id|url]" 播放页面ちゅうてき视频ある网址てき原始げんし ID。 Required
dimensions="[WIDTH|WIDTHxHEIGHT|xHEIGHT]" よう于调せい嵌入かんにゅう容器ようき大小だいしょうてき尺寸しゃくすん(以像もと为单)。 标准格式かくしき宽度 x 高度こうど,其中にんなん一个都可以省略,ただし x 必须继续高度こうど以将其指示しじ为高

しめせれい:480、​480x320、​x320 如果提供ていきょう高度こうどはたすえ宽度和服わふく务默认比率ひりつ动计さん

Some services such as Gfycat do not have standard heights and should be specified for each embed. $wgEmbedVideoDefaultWidth 以设おけLocalSettings.php 以覆盖默认宽

Optional 640
alignment="[left|center|right|inline]" はた视频てき位置いちこうひだり居中きょちゅうあるこうみぎ对齐。 うち联将まこと许多个视频并はい显示,而无需强制きょうせい换行。 Optional
description="[wikitext]" ざい嵌入かんにゅう容器ようき显示说明。 对于换行,请使用しよう &#10;(请参阅 https://www.w3.org/TR/REC-xml/#AVNormalize) Optional
container="[frame]" 指定してい要用ようよう嵌入かんにゅうてき容器ようき类型。
frameはた视频播放包装ほうそうざいMediawiki缩略图框ちゅう
Optional
urlargs="modestbranding=1&version=3" まこと许将额外てき URL さんすう追加ついかいた生成せいせいてき嵌入かんにゅう URL。 这对于仅ざい一个服务上支持的模糊选项很有用。 Optional
autoresize="false" とう视频てき大小だいしょうかい导致视频ちょう其容元素げんそ时,动调せい视频大小だいしょう Optional true
valignment="[top|middle|bottom|baseline]" はた视频てき垂直すいちょく位置いちあずかちち元素げんそてき顶部、ちゅう间、底部ていぶあるもと线对齐。 使用しよう此参すう强制きょうせい对齐さんすう为内联。 Optional

しめせれい

れい如:#1

れい如, YouTube てき视频使用しよう youtube ふく务选择器。 您可以指定してい原始げんし ID:

{{#ev:youtube|eAORm-8b1Eg}}

あるもの指定していかんせいてき网址:

{{#ev:youtube|https://www.youtube.com/watch?v=eAORm-8b1Eg}}

ようしょうどう一视频显示为右对齐的大缩略图,并附ゆう说明,请执ぎょう以下いか操作そうさ

{{#ev:youtube|https://www.youtube.com/watch?v=eAORm-8b1Eg|1000|right|Let eet GO|frame}}

よう让视频在特定とくてい时间だい码开はじめ,请使用しよう urlargs(网址さんすうさんすう。 从自てい义 URL ちゅう获取其余てき URL さんすう,并将它们放いれ urlargs なか。 请注意ちゅうい,并非所有しょゆう视频ふく务都支持しじ额外てき网址さんすうあるもの其网さんすう可能かのうゆう不同ふどうてき键。

https://www.youtube.com/watch?v=eAORm-8b1Eg&start=76
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|||||start=76}}

URL さんすう可用かよう于剪きり视频并循环播放:

https://www.youtube.com/watch?v=eAORm-8b1Eg&start=160&end=180&loop=1
{{#ev:youtube|https://www.youtube.com/watch?v=eAORm-8b1Eg|||||start=160&end=180&loop=1}}

视频标签てき支持しじ

版本はんぽん 2.5 おこり添加てんかりょう对未维护てき视频标签扩展ほどじょ标签てき支持しじ

原始げんし扩展ぶん档中:

视频链接扩展まこと许在文章ぶんしょうちゅう嵌入かんにゅうYouTube视频;まこと许在单个嵌入かんにゅうしき视频播放ちゅう播放个链せってき视频,当用とうよう户单击视频链せっ时首显示。

‎<vplayer /> 指定してい播放应在页面中出なかいで现的位置いち,{{#vlink}} 解析かいせき函数かんすうまこと许创たて特定とくてい视频てき链接。

<span id="‎<evlplayer>_—_Tag_hook_for_video_container">

‎<evlplayer> — 视频容器ようきてき标签钩子

为了こうきさきけんよう,这里也可以使用しよう ‎<vplayer> 标记。

‎<evlplayer> 标记よう于在页面ちゅう定位ていい视频播放容器ようき

<evlplayer id="player id" w="width" h="height" class="class" style="style">だま认路みち</evlplayer>

だま认情况下,以将だま认视频设おけ为填たかし容器ようき,而不だま认路みち

<evlplayer id="player1" w="480" h="360" service="youtube" defaultid="eAORm-8b1Eg" />
属性ぞくせい 必要ひつようてき だま 描述
id Optional default 此容てき选唯いち标识
w Optional 800 生成せいせい嵌入かんにゅうしき播放时要发送いた该播放てき宽度。
h Optional 从宽实现 16:9 Height to send to the embedded player when it's generated.
class Optional Additional CSS class to add to the container ‎<div>.
style Optional Additional in-line CSS to apply to the container ‎<div>.
defaultid Optional Video ID of default video, if you want a default video.
service Optional Service of default video, if you want a default video.

An important caveat to make note of, is that the w and h attributes only effect the video that is being included into the container ‎<div>, and not the actual container. For styling of the container, please use the class or style attributes.

#evl — Parser function for video links

The use of the {{#vlink}} parser function is also acceptable here for backwards compatibility.
{{#evl:<视频ID>|<链接ぶんほん>|<よう播放てき视频>|service=youtube|player=<player id>}}

In addition to all of the attributes supported by the #evt tag, these specific attributes apply to the #evl (and #vlink) tags. To maintain backwards compatibility, if you do not define a service then youtube is assumed.

属性ぞくせい 必要ひつようてき だま 描述
视频ID Required The ID of the video you would like to play or a comma separated list of videos to play. Please note that the use of multiple video IDs separated by a semicolon is now deprecated.
链接文字もじ Required ようざい链接ない显示てきぶんほん
よう播放てき视频 Optional The number that represents the video to play from video ID if it is a comma separated list of IDs.
player id Optional default よう于加载视频的播放容器ようきNote that the ID default will only exist if you’ve defined a player with no ID.
initial video やめ弃用 在原ありわらはじめ视频链接ちゅう,这将てい义在てい义多个视频时くびさき播放てき视频。 Please see notes about in video id and start.
开始 やめ弃用 0:00 In the original VideoLink, this defined the start time of a video. Since we support multiple video services, this feature can now be replicated with the urlargs parameter. For backwards compatibility, this attribute will be respect on videos with the service youtube.

视频链接しめせれい

Creating a video list allows video links to create a playlist on the fly using the youtube and youtubevideolist service.

Even if you define a service the system will use youtube if a list of videos is provided.
<evlplayer w="width" h="height" class="class" style="style" id="example-player">だま认路みち</evlplayer>
{{#evl:21X5lGlDOfg|NASA Live|1|player=example-player}}
{{#evl:lEyCq2KRZik|IIS Q&A|2|player=example-player}}
{{#evl:OLeWbRdW6rY|Space Station Tour|3|player=example-player}}


支持しじてきふく

版本はんぽん 2.x 开始,EmbedVideo 支持しじ从以ふく嵌入かんにゅう视频内容ないよう

站点 ふく名称めいしょう ID example 网址しめせれい 备注
Archive.org 视频 archiveorg electricsheep-flock-244-80000-6 https://archive.org/embed/electricsheep-flock-244-80000-6
Bambuser bambuser 5262334 http://bambuser.com/v/5262334 广播
bambuser_channel 频道
Beam beam RocketBear https://beam.pro/RocketBear ながれ
Bing bing 31ncp9r7l http://www.bing.com/videos/watch/video/adorable-cats-attempt-to-eat-invisible-tuna/31ncp9r7l
Blip.tv blip http://blip.tv/vinylrewind/review-6864612 Blip 需要じゅよう视频页面てきかんせい URL,并且接受せつじゅ原始げんし ID。
C3TV mediacccde 32c3-7305-quantum_cryptography https://media.ccc.de/v/32c3-7305-quantum_cryptography
CollegeHumor collegehumor 6875289 http://www.collegehumor.com/video/6875289/batman-says-his-goodbyes
Dailymotion dailymotion x1adiiw_archer-waking-up-as-h-jon-benjamin_shortfilms http://www.dailymotion.com/video/x1adiiw_archer-waking-up-as-h-jon-benjamin_shortfilms
Daum TVPot tvpotObtain the URL or ID from the share menu URL. s9011HdLzYwpLwBodQzCHRB http://tvpot.daum.net/v/s9011HdLzYwpLwBodQzCHRB
Div Share divshare
Edutopia Edutopia content moved to YouTube. Please use the YouTube service selector below.
FunnyOrDie funnyordie c61fb67ac9 http://www.funnyordie.com/videos/c61fb67ac9/to-catch-a-predator-elastic-heart-edition
Gfycat gfycat BruisedSilentAntarcticfurseal http://www.gfycat.com/BruisedSilentAntarcticfurseal
Hitbox hitbox Washuu http://www.hitbox.tv/Washuu
JW Player jwplayer cr5d8nbu-8ZpoNmmJ https://content.jwplatform.com/players/cr5d8nbu-8ZpoNmmJ.html
Kickstarter kickstarter elanlee/exploding-kittens https://www.kickstarter.com/projects/elanlee/exploding-kittens
Metacafe metacafe 11404579 http://www.metacafe.com/watch/11404579/lan_party_far_cry_4/
Nico Nico Video nico sm24394325 http://www.nicovideo.jp/watch/sm24394325
RuTube rutube b698163ccb67498db74d50cb0f22e556 http://rutube.ru/video/b698163ccb67498db74d50cb0f22e556/
SoundCloud soundcloud https://soundcloud.com/skrillex/skrillex-rick-ross-purple-lamborghini SoundCloud需要じゅようかんせいてきURL。
TeacherTube teachertube 370511 http://www.teachertube.com/video/thats-a-noun-sing-along-hd-version-370511
TED Talks ted bruce_aylward_humanity_vs_ebola_the_winning_strategies_in_a_terrifying_war http://www.ted.com/talks/bruce_aylward_humanity_vs_ebola_the_winning_strategies_in_a_terrifying_war
Tubi TV tubitv 318409 http://tubitv.com/video/318409
Tudou tudou mfQXfumwiew http://www.tudou.com/listplay/mfQXfumwiew.html
Twitch twitch twitchplayspokemon http://www.twitch.tv/twitchplayspokemon 实况りゅう
twitchvod Archived Videos on Demand
Videomaten videomaten
Vimeo vimeo 105035718 http://vimeo.com/105035718
Vine vine h2B7WMtuX2t https://vine.co/v/h2B7WMtuX2t
Yahoo Screen (Archived 2013-09-20 at the Wayback Machine) yahoo katy-perry-dances-sharks-2015-024409668 https://screen.yahoo.com/videos-for-you/katy-perry-dances-sharks-2015-024409668.html
YouTube youtube pSsYTj9kCHE https://www.youtube.com/watch?v=pSsYTj9kCHE 单个视频
youtubeplaylist https://www.youtube.com/watch?v=CW_PbErQ_c8&list=PL76E80C7F756A2047 放列ほうれつひょう
youtubevideolist https://www.youtube.com/watch?v=CW_PbErQ_c8&playlist=CW_PbErQ_c8,CW_PbErQ_c8 视频れつひょう
Youku youku XODc3NDgzMTY4 http://v.youku.com/v_show/id_XODc3NDgzMTY4.html

あんそう

  • しもぶんけん,并将其放置ほうちざいextensions/ぶんけん夹中てきEmbedVideo录内。
  • はたしも列代れつだい放置ほうちざい您的LocalSettings.php てき底部ていぶ
    wfLoadExtension( 'EmbedVideo' );
    
  • Configure as required
  • Yes 完成かんせいざい您的wikiじょう导航いたりSpecial:Version,以验证已成功せいこうやすそう扩展。

配置はいち

变量 だま认值 类型 描述
$wgEmbedVideoAddFileExtensions true ぬの尔值 启用あるきんようはた视频/おと频文けん扩展めい添加てんかいたまこと许上传的ぶんけんれつひょうちゅう
$wgEmbedVideoEnableVideoHandler true ぬの尔值 启用あるきんようよう于在文章ぶんしょうちゅう显示嵌入かんにゅう视频てき视频媒体ばいたい处理ほどじょ
$wgEmbedVideoEnableAudioHandler true ぬの尔值 Enable or disable the audio media handlers for displaying embedded audio in articles.
$wgEmbedVideoDefaultWidth '' 整数せいすう Globally override the default width of video players. When not set this uses the video service's default width which is typically 640 pixels.
$wgEmbedVideoMinWidth '' 整数せいすう Minimum width of video players. Widths specified below this value will be automatically bounded to it.
$wgEmbedVideoMaxWidth '' 整数せいすう 视频播放てき最大さいだい宽度。 ざい此值上方かみがた指定していてき宽度はた动绑じょういた该值。
$wgFFmpegLocation '/usr/bin/ffmpeg' くし 设置 ffmpeg 二进制文件的位置。
$wgFFprobeLocation '/usr/bin/ffprobe' くし 设置 ffprobe 二进制文件的位置。

版本はんぽん历史

v2.9.0
  • Fix stored XSS in AudioTransformOutput and VideoTransformOutput.
  • Fix autoResize on mobile.
  • Fix video caption escaping the container.
  • Handle multiple video sizes per page in resize.
  • Move beam service to mixer.
  • Add a default link title for #evl/#vlink.
  • Add spotify playlist embeds.
  • Add facebook video embeds.
  • Fix centering of videos.
  • Add Microsoft Stream service.
  • Add title to iframes.
  • Add API help messages for 1.33 compatibility.
  • Fix static analysis issues.
  • Fix Twitch embeds.
v2.8.0
  • Renamed hitbox.tv to smashcast.tv.
  • Updated Nico Video embed code.
  • Added support for Twitch clips.
  • Fix issues with Twitch VODs.
  • Removed unused $wgFFmpegLocation that was interferring with TimedMediaHandler.
  • Added Polish translation.
v2.7.4
  • Added support for playlist to evlplayer
  • Added support for youtube video list
  • Updated Documentation for evlplayer
  • Added missing dependency for evlplayer in extension.json
v2.7.3
  • Default Twitch VOD to autoplay=false by default
  • Allow videos to be sized in 1:1 aspect ratios for special use cases.
v2.7.2
  • Added feature to evlplayer to allow default video content
v2.7.1
  • Fixed issue with youku videos not embedding properly on https enabled wikis.
v2.7.0
  • Added SoundCloud support
  • Added ability to use service name as a parser tag (if not defined previously)
v2.6.1

发行说明

使用しよう解析かいせき函数かんすうさく为视频剪辑的注入ちゅうにゅうつくえせいあずか扩展标记しょう对)てき主要しゅようこう处是解析かいせき函数かんすう利用りようばんさんすう形式けいしき{{{1}}})。 れい如,かり设您发现自己じこ制作せいさくりょう许多缩略图大しょうてきYouTube视频,ぞう图像いち样右对齐。 您可以创けんいち个名为 Template:Youtube_tn てきばん,其中可能かのう包含ほうがん以下いか内容ないよう

<div class="thumb tright">
{{#ev:youtube|{{{1}}}|{{{2|100}}}}}
</div>

しかきさき这样称呼しょうこ它:

{{youtube tn|someYoutubeId}}

报告问题

There is an issue tracker set up on the GitLab project page.

贡献

欢迎错误报告、こうのう请求补丁。 New contributors can be added to the GitLab project if there is sufficient interest.

まいり

  • Extension:EmbedVideo (fork): 嵌入かんにゅうしき视频てきぶんささえ — 此扩てんてきさらちゅうじゅう隐私てき版本はんぽんNote that only a subset of services are supported, but new services can be requested through GitHub.

网页链接

參考さんこう