Extension:EmbedVideo (fork)
EmbedVideo (fork) リリースの状態: 安定 |
|
---|---|
実装 | パーサー関数 |
説明 | Adds a parser function for embedding videos from popular sources |
作者 | Octfx, Alistair3149, Alexia E. Smith, Andrew Whitworth, Jim R. Wilson |
メンテナー | Octfx |
最新バージョン | 3.4.1 (Continuous updates) |
互換性の方針 | master は後方互換性を維持しています。 |
MediaWiki | 1.39+ |
PHP | >=8.0 |
Composer | starcitizenwiki/embedvideo |
ライセンス | MIT ライセンス |
ダウンロード | |
EmbedVideo (fork) 拡張機能の翻訳にご協力ください | |
The EmbedVideo extension is a MediaWiki extension which adds a parser function called #ev
and various parser tags like <youtube>
for embedding video clips from various video sharing services.
It also adds video and audio media handlers to support transforming standard [[File:Example.mp4]]
file links into embedded HTML5 <video>
and <audio>
tags.
This privacy enhanced fork adds a toggleable setting that only loads external content after the user gave explicit consent by clicking the video.
Do note that thumbnails are still fetched from the respective service, which results in a connection to an external url.
This behaviour can be disabled by setting $wgEmbedVideoFetchExternalThumbnails
to false
.
インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のEmbedVideo
という名前のディレクトリ内に配置します。 - 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'EmbedVideo' );
- 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
使用法
Media Handler
For locally uploaded content the process for displaying it on a page is the same as an image. See the image syntax documentation on MediaWiki.org 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]]
Additionally, a cover image can be set for video files by specifying a cover=
key.
[[File:Example.mp4|start=2|end=6|poster=File:LocalFile.png]]
利用できるオプション
The following options are available when using the media handler for local files.
Options are added to the wikitext like |poster=File:...
or |start=2
.
- loop
- Loops the audio / video
- autoplay
- Automatically plays the file
- nocontrols
- Disables the control elements
Options only available for video files:
- poster / cover
- Sets a local image file as the cover of the video
- muted
- Mutes the audio track of the video (required for autoplay)
- gif
- Special option that sets autoplay, muted, loop and nocontrols e.g. makes the video behave like a gif
When $wgEmbedVideoUseEmbedStyleForLocalVideos
is enabled two additional options are available
- title
- Title of the video
- description
- Description shown below the video
Parser function #ev
The EmbedVideo parser function expects to be called in any of the following ways:
{{#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}}
However, if needed optional arguments may be left blank by not putting anything between the pipes:
{{#ev:service|id|||description}}
Alternatively each parameter can be used in any order as a named parameter. The following parameter are available:
id
dimensions
alignment
description
container
urlArgs
autoResize
vAlignment
width
height
poster
/cover
- This only has an effect if
$wgEmbedVideoRequireConsent
is set to true
- This only has an effect if
title
- This only has an effect if
$wgEmbedVideoRequireConsent
is set to true
- This only has an effect if
Do note mixing named and unnamed parameters will require you to add all unnamed parameters (and blanks) in the previously mentioned order.
E.g. using named id and unnamed description {{#ev:service||||This is the Description|id=abc}}
/ {{#ev:service|id=abc|||This is the Description}}
Supported Services
As of version 3.x, EmbedVideo supports embedding video content from the following services:
- New Services
New services can be requested by using the following link or clicking New Issue
.
Configuration
Variable | Default Value | Description |
---|---|---|
$wgEmbedVideoAddFileExtensions
|
true
|
Boolean - Enable or disable adding video/audio file extensions to the list of allowable files to be uploaded. |
$wgEmbedVideoEnableVideoHandler
|
true
|
Boolean - Enable or disable the video media handlers for displaying embedded video in articles. |
$wgEmbedVideoEnableAudioHandler
|
true
|
Boolean - Enable or disable the audio media handlers for displaying embedded audio in articles. |
$wgEmbedVideoLazyLoadLocalVideos
|
false
|
Boolean - Sets 'preload="none"' on every |
$wgEmbedVideoUseEmbedStyleForLocalVideos
|
false
|
Boolean - Styles local videos like they are embedded content. DO NOTE: When changing this, every page with a local video needs to be updated in the parser cache! |
$wgEmbedVideoDefaultWidth
|
640
|
Integer - 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
|
null
|
Integer - Minimum width of video players. Widths specified below this value will be automatically bounded to it. |
$wgEmbedVideoMaxWidth
|
null
|
Integer - Maximum width of video players. Widths specified above this value will be automatically bounded to it. |
$wgFFprobeLocation
|
/usr/bin/ffprobe
|
String - Set the location of the ffprobe binary. |
$wgEmbedVideoEnabledServices
|
null
|
Array - Array of service names that are allowed, if empty all services are available. |
$wgEmbedVideoRequireConsent
|
true
|
Boolean - Set to true to only load the iframe if the user clicks it. |
$wgEmbedVideoFetchExternalThumbnails
|
true
|
Boolean - Set to false to disable fetching video thumbnails from the external video provider. Currently only works for YouTube and Vimeo. |
関連項目
この拡張機能は以下のウィキ ファーム/ウィキ ホスト/パッケージに含まれています: これは正式な一覧ではありません。 一部のウィキ ファーム/ウィキ ホスト/パッケージは、ここに記載されていなくてもこの拡張機能を含んでいる場合があります。 必ずご利用のウィキ ファーム、ウィキ ホスト、バンドルで確認してください。 |
- Stable extensions/ja
- Parser function extensions/ja
- Extensions supporting Composer/ja
- MIT licensed extensions/ja
- Extensions in GitHub version control/ja
- ParserFirstCallInit extensions/ja
- BeforePageDisplay extensions/ja
- ArticlePurge extensions/ja
- All extensions/ja
- Extensions included in BlueSpice/ja
- Extensions included in Canasta/ja
- Extensions included in ProWiki/ja
- Extensions included in wiki.gg/ja
- Extensions included in WikiForge/ja