Skip to content

Commit 41d6c49

Browse files
committed
Merge branch 'release/v3.4.0'
2 parents b2bbbb6 + 00666a2 commit 41d6c49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1396
-257
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.storybook/
2+
/docs/
3+
/i18n/
4+
/node_modules/
5+
/vendor/
6+
Gruntfile.js

.eslintrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"wikimedia/client",
5+
"wikimedia/jquery",
6+
"wikimedia/mediawiki"
7+
],
8+
"globals": {
9+
"require": "readonly",
10+
"module": "readonly"
11+
},
12+
"rules": {
13+
"one-var": "off",
14+
"//": [
15+
"off",
16+
"ResourceLoader's `packageFiles` do not require wrapping but the `module` option is only available in ES6+."
17+
],
18+
"no-implicit-globals": "off"
19+
}
20+
}

.github/workflows/lint-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Installing PHP
1414
uses: shivammathur/setup-php@master
1515
with:
16-
php-version: '7.4'
16+
php-version: '8.0'
1717
- name: Get Composer Cache Directory 2
1818
id: composer-cache
1919
run: |

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@
44
.DS_Store
55
.svn
66
/vendor
7-
composer.lock
7+
/composer.lock
8+
/node_modules
9+
/.eslintcache
10+
/package-lock.json

EmbedVideo.i18n.magic.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
$magicWords['en'] = [
1414
'ev' => [ 0, 'ev' ],
15+
'evt' => [ 0, 'evt' ],
1516
'evu' => [ 0, 'evu' ],
17+
'evl' => [ 0, 'evl' ],
18+
'vlink' => [ 0, 'vlink' ],
1619
'ev_start' => [ 0, 'start=$1' ],
1720
'ev_end' => [ 0, 'end=$1' ],
1821
'cover' => [ 0, 'cover=$1' ],

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,41 @@ Alternatively each parameter can be used in any order as a named parameter. The
150150
**Do note** mixing named and unnamed parameters will require you to add all unnamed parameters (and blanks) in the previously mentioned order.
151151
E.g. using named id and unnamed description `{{#ev:service||||This is the Description|id=abc}}`/ `{{#ev:service|id=abc|||This is the Description}}`
152152

153+
### \#evu - Embed Video Url
154+
The `{{#evu}}` parser function tries to extract the service from the host name of an url.
155+
156+
It takes the same arguments as `{{#ev}}`.
157+
158+
### \#evl - Embed Video Link
159+
The support for `{{#evl}} / {{#vlink}}` and `<evlplayer> / <vplayer>` has been added with version 3.4.0.
160+
161+
The link parser function takes the following arguments:
162+
* `id` - Video ID
163+
* `text` - Link Text
164+
* `player` - ID of the `<evlplayer>` if multiple exist on a page
165+
* `service` - Name of the embed service, defaults to YouTube
166+
167+
Named arguments can be passed in any order, unnamed args must be passed in the order defined above.
168+
169+
#### \<evlplayer> / \<vplayer>
170+
The corresponding player that plays the videos defined by `{{#evl}}` links.
171+
172+
Note that this implementation differs from EmbedVideo v2.x in the following areas:
173+
* No `default content` is supported, i.e. text inside the tags
174+
* A default video id should be defined, else the player displays a blank embed
175+
* In the old implementation nothing was shown
176+
* No `style` attribute can be set
177+
* Video lists are not supported
178+
179+
### Example
180+
```mediawiki
181+
<evlplayer w="width" h="height" class="class" id="example-player" defaultid="pSsYTj9kCHE"></evlplayer>`
182+
{{#evl:21X5lGlDOfg|NASA Live|player=example-player}}`
183+
{{#evl:6ZFbXIJkuI1dVNWvzJzown|text=Spotify Track|service=spotifytrack|player=example-player}}
184+
```
185+
186+
Shows a YouTube embed for the video `pSsYTj9kCHE` and two video links, one for another YouTube video (NASA Live) and a Spotify track.
187+
153188
## Examples
154189

155190
## SharePoint
@@ -228,6 +263,7 @@ As of version 3.x, EmbedVideo supports embedding video content from the followin
228263
| Site | Service Name(s) | ID Example | URL Example(s) |
229264
|----------------------------------------------------------|---------------------------------|--------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
230265
| [Archive.org Videos](https://archive.org/details/movies) | `archiveorg` | electricsheep-flock-244-80000-6 | https://archive.org/details/electricsheep-flock-244-80000-6<br/>https://archive.org/embed/electricsheep-flock-244-80000-6 |
266+
| [Bandcamp](https://bandcamp.com/) | `bandcamp` | 1003592798 | https://emptyhousesmusic.bandcamp.com/album/empty-houses (Click on share/embed, and copy the id after `album=`) |
231267
| [Bilibili](https://www.bilibili.com/) | `bilibili` | BV1Hz4y1k7ae | https://player.bilibili.com/player.html?bvid=1Hz4y1k7ae&amp;page=1 |
232268
| [DailyMotion](https://dailymotion.com/) | `dailymotion` | x1adiiw_archer-waking-up-as-h-jon-benjamin_shortfilms | http://www.dailymotion.com/video/x1adiiw_archer-waking-up-as-h-jon-benjamin_shortfilms |
233269
| [KakaoTV](https://tv.kakao.com/) | `kakaotv` | 301157950 | https://play-tv.kakao.com/embed/player/cliplink/301157950 |

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "starcitizenwiki/embedvideo",
3-
"version": "3.3.0",
3+
"version": "3.4.0",
44
"type": "mediawiki-extension",
55
"description": "Adds a parser function embedding video from popular sources.",
66
"license": "MIT",

extension.json

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "EmbedVideo",
3-
"version": "3.3.0",
3+
"version": "3.4.0",
44
"author": [
55
"[https://www.mediawiki.org/wiki/User:Octfx Octfx]",
66
"[https://www.mediawiki.org/wiki/User:Alistair3149 Alistair3149]",
@@ -35,15 +35,59 @@
3535
"embedvideo": "MediaWiki\\Extension\\EmbedVideo\\ApiEmbedVideo"
3636
},
3737
"ResourceModules": {
38+
"ext.embedVideo.messages": {
39+
"messages": [
40+
"embedvideo-service-archiveorg",
41+
"embedvideo-service-bandcamp",
42+
"embedvideo-service-bilibili",
43+
"embedvideo-service-dailymotion",
44+
"embedvideo-service-kakaotv",
45+
"embedvideo-service-loom",
46+
"embedvideo-service-navertv",
47+
"embedvideo-service-niconico",
48+
"embedvideo-service-soundcloud",
49+
"embedvideo-service-sharepoint",
50+
"embedvideo-service-spotify",
51+
"embedvideo-service-twitch",
52+
"embedvideo-service-videolink",
53+
"embedvideo-service-vimeo",
54+
"embedvideo-service-youtube",
55+
"embedvideo-service-localvideo",
56+
"embedvideo-service-externalvideo",
57+
"embedvideo-consent-privacy-notice-text",
58+
"embedvideo-consent-privacy-policy"
59+
]
60+
},
61+
"ext.embedVideo.videolink": {
62+
"es6": true,
63+
"packageFiles": [
64+
"ext.embedVideo.videolink.js",
65+
{ "name": "fetchFactory.js", "file": "fetchers/fetchFactory.js" },
66+
{ "name": "queryKeyParser.js", "file": "fetchers/queryKeyParser.js" },
67+
{ "name": "bilibili.js", "file": "fetchers/bilibili.js" },
68+
{ "name": "niconico.js", "file": "fetchers/niconico.js" },
69+
{ "name": "oembed.js", "file": "fetchers/oembed.js" },
70+
{ "name": "iframe.js", "file": "modules/iframe.js" }
71+
],
72+
"styles": [
73+
"ext.embedVideo.consent.less"
74+
],
75+
"position": "top",
76+
"targets": [
77+
"desktop",
78+
"mobile"
79+
]
80+
},
3881
"ext.embedVideo.consent": {
3982
"es6": true,
4083
"packageFiles": [
4184
"ext.embedVideo.consent.js",
42-
{ "name": "fetchFactory.js", "file": "fetchers/fetchFactory.js" },
43-
{ "name": "queryKeyParser.js", "file": "fetchers/queryKeyParser.js" },
44-
{ "name": "bilibili.js", "file": "fetchers/bilibili.js" },
45-
{ "name": "niconico.js", "file": "fetchers/niconico.js" },
46-
{ "name": "oembed.js", "file": "fetchers/oembed.js" }
85+
{ "name": "fetchFactory.js", "file": "fetchers/fetchFactory.js" },
86+
{ "name": "queryKeyParser.js", "file": "fetchers/queryKeyParser.js" },
87+
{ "name": "bilibili.js", "file": "fetchers/bilibili.js" },
88+
{ "name": "niconico.js", "file": "fetchers/niconico.js" },
89+
{ "name": "oembed.js", "file": "fetchers/oembed.js" },
90+
{ "name": "iframe.js", "file": "modules/iframe.js" }
4791
],
4892
"styles": [
4993
"ext.embedVideo.consent.less"
@@ -99,7 +143,7 @@
99143
},
100144
"EmbedVideoUseEmbedStyleForLocalVideos": {
101145
"description": "Styles local videos like they are embedded",
102-
"value": false
146+
"value": true
103147
},
104148
"EmbedVideoEnableAudioHandler": {
105149
"description": "Enables the audio handler which displays local videos using the html5 <audio> tag.",
@@ -126,11 +170,11 @@
126170
"value": []
127171
},
128172
"EmbedVideoRequireConsent": {
129-
"description": "Explicitly require consent by only loading the iframe if the user clicks it",
173+
"description": "Explicitly require consent by only loading the iframe after the user clicks play",
130174
"value": true
131175
},
132176
"EmbedVideoFetchExternalThumbnails": {
133-
"description": "Don't try to fetch thumbnails when consent is required.",
177+
"description": "Fetch video thumbnails by querying the respective external oembed endpoints. This results in a http call.",
134178
"value": true
135179
},
136180
"EmbedVideoShowPrivacyNotice": {

i18n/de.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
},
1111
"embedvideo-description": "Fügt eine Parserfunktion hinzu, mittels derer Videos populärer Dienste eingebettet werden können.",
1212
"embedvideo-load": "$1 laden",
13-
"embedvideo-type-audio": "audio",
13+
"embedvideo-type-audio": "Audio",
1414
"embedvideo-type-content": "Inhalt",
15-
"embedvideo-type-video": "video",
15+
"embedvideo-type-video": "Video",
1616
"embedvideo-consent-privacy-policy": "Datenschutzrichtlinie",
1717
"embedvideo-consent-privacy-notice-text": "$1 sammelt möglicherweise persönliche Daten.",
1818
"embedvideo-consent-privacy-notice-continue": "Fortfahren",
@@ -31,7 +31,7 @@
3131
"embedvideo-error-evp_deprecated": "Die Parserfunktion „#evp“ wurde in EmbedVideo 2.0 verworfen; alle Parserfunktionen-Tags sind in „#ev“ zu ändern.",
3232
"embedvideo-error-container": "Der Wert für „container“ ist ungültig.",
3333
"embedvideo-video-long-desc": "$1, $2 Codec, Länge $3, $4x$5 Pixel, $6 insgesamt",
34-
"embedvideo-audio-long-desc": "$1, $2 codec, Länge $3, $4 insgesamt",
34+
"embedvideo-audio-long-desc": "$1, $2 Codec, Länge $3, $4 insgesamt",
3535
"embedvideo-error-cantdecode_evu": "Konnte das Video von $1 nicht analysieren",
3636
"apihelp-embedvideo-summary": "Ermittelt den generierten Videoeinbettungscode für die angegebenen Parameter.",
3737
"apihelp-embedvideo-param-service": "Name des Dienstes (youtube, twitch etc.)",

i18n/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"embedvideo-consent-privacy-notice-dismiss": "Dismiss",
1414
"embedvideo-service-archiveorg": "Archive.org",
1515
"embedvideo-service-bilibili": "Bilibili",
16+
"embedvideo-service-bandcamp": "Bandcamp",
1617
"embedvideo-service-dailymotion": "Dailymotion",
1718
"embedvideo-service-kakaotv": "KakaoTV",
1819
"embedvideo-service-loom": "Loom",
@@ -22,10 +23,11 @@
2223
"embedvideo-service-sharepoint": "SharePoint",
2324
"embedvideo-service-spotify": "Spotify",
2425
"embedvideo-service-twitch": "Twitch",
26+
"embedvideo-service-videolink": "Video Link",
2527
"embedvideo-service-vimeo": "Vimeo",
2628
"embedvideo-service-youtube": "YouTube",
2729
"embedvideo-service-localvideo": "Local File",
28-
"embedvideo-service-externalvideo": "External Video ",
30+
"embedvideo-service-externalvideo": "External Video",
2931
"embedvideo-play": "Play Video",
3032
"embedvideo-error-missingparams": "EmbedVideo is missing a required parameter.",
3133
"embedvideo-error-service": "EmbedVideo does not recognize the video service \"$1\".",

i18n/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"embedvideo-consent-privacy-notice-text": "$1 podría recabar datos personales.",
1414
"embedvideo-consent-privacy-notice-continue": "Continuar",
1515
"embedvideo-consent-privacy-notice-dismiss": "Descartar",
16+
"embedvideo-service-videolink": "Enlace del video",
1617
"embedvideo-service-externalvideo": "Video external",
1718
"embedvideo-play": "Reproducir",
1819
"embedvideo-error-missingparams": "EmbedVideo; falta un parámetro requerido.",

i18n/he.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"embedvideo-service-bilibili": "ביליבילי",
1818
"embedvideo-service-spotify": "ספוטיפיי",
1919
"embedvideo-service-twitch": "טוויטץ'",
20+
"embedvideo-service-videolink": "קישור וידאו",
2021
"embedvideo-service-vimeo": "וימאו",
2122
"embedvideo-service-youtube": "יוטיוב",
2223
"embedvideo-service-localvideo": "קובץ מקומי",

i18n/ia.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"embedvideo-consent-privacy-notice-text": "$1 pote colliger datos personal.",
1414
"embedvideo-consent-privacy-notice-continue": "Continuar",
1515
"embedvideo-consent-privacy-notice-dismiss": "Clauder",
16+
"embedvideo-service-videolink": "Ligamine video",
1617
"embedvideo-service-localvideo": "File local",
1718
"embedvideo-service-externalvideo": "Video externe",
1819
"embedvideo-play": "Reproducer video",
@@ -27,8 +28,8 @@
2728
"embedvideo-error-unknown": "EmbedVideo ha incontrate un error incognite durante le tentativa de generar iste bloco de incastration de video. ($1)",
2829
"embedvideo-error-evp_deprecated": "Le function de analysator #evp ha devenite obsolescente in EmbedVideo 2.0. Per favor converte tu etiquetta de function de analysator a #ev.",
2930
"embedvideo-error-container": "Le parametro fornite pro 'container' non es valide.",
30-
"embedvideo-video-long-desc": "$1, codec $2, longitude $3, $4x$5 pixels, $6 in total",
31-
"embedvideo-audio-long-desc": "$1, codec $2, longitude $3, $4 in total",
31+
"embedvideo-video-long-desc": "$1, codec $2, longitude $3, $4 x $5 pixels, generalmente $6",
32+
"embedvideo-audio-long-desc": "$1, codec $2, longitude $3, generalmente $4",
3233
"embedvideo-error-cantdecode_evu": "Non poteva analysar video de $1",
3334
"embedvideo-error-url-not-whitelisted": "Le URL fornite non es definite in $wgAllowExternalImagesFrom",
3435
"apihelp-embedvideo-summary": "Obtener codice de incastration de video generate pro le parametros date.",

i18n/ko.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"embedvideo-service-soundcloud": "사운드 클라우드",
2424
"embedvideo-service-spotify": "스포티파이",
2525
"embedvideo-service-twitch": "트위치",
26+
"embedvideo-service-videolink": "비디오 링크",
2627
"embedvideo-service-vimeo": "비메오",
2728
"embedvideo-service-youtube": "유튜브",
2829
"embedvideo-service-localvideo": "로컬 파일",

i18n/lb.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"embedvideo-consent-privacy-policy": "Dateschutz",
1212
"embedvideo-consent-privacy-notice-continue": "Virufueren",
1313
"embedvideo-consent-privacy-notice-dismiss": "Verwerfen",
14+
"embedvideo-service-videolink": "Videolink",
1415
"embedvideo-service-localvideo": "Lokale Fichier",
1516
"embedvideo-service-externalvideo": "Externe Video",
1617
"embedvideo-play": "Video spillen",

i18n/mk.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"embedvideo-consent-privacy-notice-text": "$1 може да собира лични податоци.",
1414
"embedvideo-consent-privacy-notice-continue": "Продолжи",
1515
"embedvideo-consent-privacy-notice-dismiss": "Тргни",
16+
"embedvideo-service-videolink": "Видеоврска",
1617
"embedvideo-service-localvideo": "Месна податотека",
1718
"embedvideo-service-externalvideo": "Надворешно видео",
1819
"embedvideo-play": "Пушти видео",

i18n/skr-arab.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"embedvideo-consent-privacy-notice-continue": "جاری رکھو",
1111
"embedvideo-consent-privacy-notice-dismiss": "مکاؤ",
1212
"embedvideo-service-dailymotion": "ڈیلی موشن",
13+
"embedvideo-service-videolink": "وڈیو لنک",
1314
"embedvideo-service-vimeo": "ویمیو",
1415
"embedvideo-service-youtube": "یوٹیوب",
1516
"embedvideo-service-localvideo": "لوکیل فائل",

i18n/sl.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"embedvideo-consent-privacy-notice-text": "$1 mogoče zbira osebne podatke.",
1414
"embedvideo-consent-privacy-notice-continue": "Nadaljuj",
1515
"embedvideo-consent-privacy-notice-dismiss": "Opusti",
16+
"embedvideo-service-videolink": "Povezava na video",
1617
"embedvideo-service-localvideo": "Lokalna datoteka",
1718
"embedvideo-service-externalvideo": "Zunanji video",
1819
"embedvideo-play": "Predvajaj video",

i18n/zh-hans.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"authors": [
44
"Alistair3149",
55
"GuoPC",
6+
"LittlePaw365",
67
"Zhang8569"
78
]
89
},
@@ -16,15 +17,17 @@
1617
"embedvideo-consent-privacy-notice-continue": "继续",
1718
"embedvideo-consent-privacy-notice-dismiss": "关闭",
1819
"embedvideo-service-bilibili": "哔哩哔哩",
20+
"embedvideo-service-localvideo": "本地文件",
21+
"embedvideo-service-externalvideo": "外部视频",
1922
"embedvideo-play": "播放视频",
2023
"embedvideo-error-missingparams": "EmbedVideo缺少一个必须的参数。",
2124
"embedvideo-error-service": "嵌入视频无法识别视频服务“$1”。",
2225
"embedvideo-error-id": "视频嵌入收到了一个对服务“$1”不可用的id “$2“",
2326
"embedvideo-error-width": "EmbedVideo收到了一个错误的高度参数“$1”",
2427
"embedvideo-error-height": "EmbedVideo收到了一个错误的高度参数“$1”",
25-
"embedvideo-error-alignment": "嵌入的视频被给予了对校准参数一个不可用的数值“$1”。可用的数值为“left”“center”或“right”。",
26-
"embedvideo-error-valignment": "嵌入的视频被给予了对校准参数一个不可用的数值“$1”。可用的数值为“上”,“中间”,“下”,或“基线”。",
27-
"embedvideo-error-urlargs": "嵌入视频接收到了一个涵盖出错方程和空白争论的URL争论列表",
28+
"embedvideo-error-alignment": "EmbedVideo的对齐参数“$1”有非法值。有效值为“left”“center”或“right”。",
29+
"embedvideo-error-valignment": "EmbedVideo的对齐参数“$1”有非法值。有效值为“top”“middle”“bottom”或“baseline”。",
30+
"embedvideo-error-urlargs": "EmbedVideo收到的URL参数列表包含畸形数据或空参数",
2831
"embedvideo-error-unknown": "EmbedVideo在尝试生成该视频嵌入块时遇到了一个未知的错误。($1)",
2932
"embedvideo-error-evp_deprecated": "#evp解析器函数在EmbedVideo 2.0中已弃用。请将您的解析器函数标记转换为#ev。",
3033
"embedvideo-error-container": "为‘集装箱’ 提供的参数为不可用的。",
@@ -37,7 +40,7 @@
3740
"apihelp-embedvideo-param-dimensions": "一个数字宽度(100)或宽比高(100 x 100)",
3841
"apihelp-embedvideo-param-alignment": "视频校准",
3942
"apihelp-embedvideo-param-description": "视频描述",
40-
"apihelp-embedvideo-param-container": "接受该框架,或留下空白",
43+
"apihelp-embedvideo-param-container": "接受框架,或留空",
4144
"apihelp-embedvideo-param-urlargs": "视频URL中额外需要通过的争论(对于部分服务)",
4245
"apihelp-embedvideo-param-autoresize": "自动调整视频大小?(是或否)"
4346
}

0 commit comments

Comments
 (0)