扩展:嵌入 式 视频
此扩 |
EmbedVideo 发行 |
|
---|---|
实现 | |
描述 | #ev |
|
|
3.4.0 (2020-10-14) | |
MediaWiki | 1.29+ |
PHP | 7.0+ |
Composer | starcitizenwiki/embedvideo |
许可协议 | MIT授權 |
Gamepedia Help Wiki | |
|
|
7,623 (Ranked 21st) | |
|
|
Vagrant |
embedvideo |
EmbedVideo 扩展#ev
<video>
<audio>
标记。
- 项目
首 页 - GitLab
上 的 文 档 源 代 码在 GitLab上 的 源 代 码程 序 错误- GitLab
的 问题 - 许可协议
- EmbedVideo
在 The MIT License下 发布。
用法
媒体 处理程 序
对于
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>
<embedvideo service="youtube">https://www.youtube.com/watch?v=eAORm-8b1Eg</embedvideo>
<youtube>https://www.youtube.com/watch?v=eAORm-8b1Eg</youtube>
解析 器 标记的 属性
描述 | |||
---|---|---|---|
service="(请参阅下
|
Required | ||
id="[id|url]"
|
播放 |
Required | |
dimensions="[WIDTH|WIDTHxHEIGHT|xHEIGHT]"
|
x x 必须继续
Some services such as Gfycat do not have standard heights and should be specified for each embed.
|
Optional | 640
|
alignment="[left|center|right|inline]"
|
Optional | 无 | |
description="[wikitext]"
|
(请参阅 https://www.w3.org/TR/REC-xml/#AVNormalize)
|
Optional | 无 |
container="[frame]"
|
|
Optional | 无 |
urlargs="modestbranding=1&version=3"
|
Optional | 无 | |
autoresize="false"
|
Optional | true
| |
valignment="[top|middle|bottom|baseline]"
|
Optional | 无 |
示 例
youtube
{{#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
(网址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}}
视频标签的 支持
从
视频链接扩展
允 许在文章 中 嵌入 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 | 从宽 |
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
{{#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
|
default will only exist if you’ve defined a player with no ID.
|
initial video | |||
开始 | 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.
<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}}
支持 的 服 务
从
站点 | 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 | |
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 | tvpot — Obtain 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 | |
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
-
完成 –在 您的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
- Added new configuration options to disable adding media handlers and file extensions.
- Fixed an uninitialized array.
- Fixed undefined indexes in the AudioHandler class.
- Fixed class properties that were unintentionally declared as static.
- Fixed RTL language issues with CSS.
发行说明
{{{1}}}
)。
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.
贡献
欢迎错误报告、
参 见
- Extension:EmbedVideo (fork):
嵌入 式 视频的 分 支 — 此扩展 的 更 注 重 隐私的 版本 。 Note that only a subset of services are supported, but new services can be requested through GitHub.
网页链接
參考
此扩 |
- Unmaintained extensions/zh
- Parser function extensions/zh
- Extensions supporting Composer/zh
- MIT licensed extensions/zh
- Extensions in GitLab version control/zh
- ParserFirstCallInit extensions/zh
- LocalisationCacheRecache extensions/zh
- All extensions/zh
- Extensions included in BlueSpice/zh
- Extensions included in Fandom/zh
- Extensions included in Miraheze/zh
- Extensions included in MyWikis/zh
- Extensions included in semantic::core/zh
- Extensions included in Telepedia/zh
- Video player extensions/zh
- YouTube extensions/zh