Vojna Enciklopedija:Postavljanje videa
Usage
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]]
Tags
The EmbedVideo parser function expects to be called in any of the following ways:
#ev - Classic Parser Tag
{{#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}}
#evt - Parser Tag for Templates
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=pSsYTj9kCHE |alignment=right }}
<embedvideo> - Tag Hook
Videos can easily be embedded with the <embedvideo></embedvideo> tag hook. The ID/URL goes as the input between the tags and parameters can be added as the tag arguments.
<embedvideo service="youtube">https://www.youtube.com/watch?v=pSsYTj9kCHE</embedvideo>
Attributes for Parser Tags
Attribute | Description |
---|---|
service="(See Supported Services below.)"
|
Required: yes
|
id="[id|url]"
|
Required: yes
|
dimensions="[WIDTH|WIDTHxHEIGHT|xHEIGHT]"
|
Required: no, Default: 640
|
alignment="[left|center|right|inline]"
|
Required: no, Default: none
|
description="[wiki text]"
|
Required: no, Default: none
|
container="[frame]"
|
Required: no, Default: none
|
urlargs="modestbranding=1&version=3"
|
Required: no, Default: none
|
autoresize="false"
|
Required: no, Default: true
|
Examples
For example, a video from YouTube uses the 'youtube' service selector. You can specify either the raw ID:
{{#ev:youtube|pSsYTj9kCHE}}
Or specify the full URL:
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE}}
To display the same video as a right aligned large thumbnail with a description:
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|1000|right|Let eet GO|frame}}
For YouTube to have the video start at a specific time code utilize the urlargs(URL arguments) parameter. Take the rest of the URL arguments from the custom URL and place them into the urlargs. Please note that not all video services support extra URL arguments or may have different keys for their URL arguments.
https://www.youtube.com/watch?v=pSsYTj9kCHE&start=76
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|||||start=76}}
URL arguments can be used to chop up a video and loop it:
https://www.youtube.com/watch?v=pSsYTj9kCHE&start=160&end=180&loop=1
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|||||start=160&end=180&loop=1}}
Supported Services
As of version 2.x, EmbedVideo supports embedding video content from the following services:
Site | Service Name(s) | ID Example | URL Example(s) | |
---|---|---|---|---|
Archive.org Videos | archiveorg | electricsheep-flock-244-80000-6 | https://archive.org/details/electricsheep-flock-244-80000-6
https://archive.org/embed/electricsheep-flock-244-80000-6 | |
Bambuser | bambuser - Broadcasts | bambuser_channel - Channels | 5262334 | http://bambuser.com/v/5262334 |
Beam | beam - Streams | 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 - Blip requires the full URL to the video page and does not accept the raw ID. | http://blip.tv/vinylrewind/review-6864612 | ||
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/ | |
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 - Live Streams | twitchvod - Archived Videos on Demand | twitchplayspokemon | http://www.twitch.tv/twitchplayspokemon |
Videomaten | videomaten | |||
Vimeo | vimeo | 105035718 | http://vimeo.com/105035718 | |
Vine | vine | h2B7WMtuX2t | https://vine.co/v/h2B7WMtuX2t | |
Yahoo Screen | yahoo | katy-perry-dances-sharks-2015-024409668 | https://screen.yahoo.com/videos-for-you/katy-perry-dances-sharks-2015-024409668.html | |
YouTube | youtube - Single Videos | youtubeplaylist - Playlists | pSsYTj9kCHE | https://www.youtube.com/watch?v=pSsYTj9kCHE
https://www.youtube.com/watch?v=CW_PbErQ_c8&list=PL76E80C7F756A2047 |
Youku | youku | XODc3NDgzMTY4 | http://v.youku.com/v_show/id_XODc3NDgzMTY4.html |
Configuration Settings
Variable | Default Value | Description |
---|---|---|
$wgEmbedVideoMinWidth | Integer - Minimum width of video players. Widths specified below this value will be automatically bounded to it. | |
$wgEmbedVideoMaxWidth | Integer - Maximum width of video players. Widths specified above this value will be automatically bounded to it. | |
$wgEmbedVideoDefaultWidth | 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. | |
$wgFFmpegLocation | /usr/bin/ffmpeg | String - Set the location of the ffmpeg binary. |
$wgFFprobeLocation | /usr/bin/ffprobe | String - Set the location of the ffprobe binary. |
Developer Notes
The major benefit of using a parser function as the injection mechanism for video clips (as opposed to an extension tag) is that parser functions can utilize template parameters (of the form {{{1}}}).
For example, say you found yourself making a lot of YouTube videos in thumbnail size, right-aligned like an image. You might make a template called Template:Youtube_tn
which could contain this:
<div class="thumb tright"> {{#ev:youtube|{{{1}}}|{{{2|100}}}}} </div>
And then call it like this:
{{youtube tn|someYoutubeId}}
Reporting Bugs
There is an issue tracker set up on the Github project page.
Contributing
Bug reports, feature requests, and patches are always welcome. New contributors can be added to the Github project if there is sufficient interest.