Skip to content

Commit

Permalink
Merge branch 'release/v3.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
octfx committed Nov 9, 2023
2 parents b2bbbb6 + 00666a2 commit 41d6c49
Show file tree
Hide file tree
Showing 60 changed files with 1,396 additions and 257 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.storybook/
/docs/
/i18n/
/node_modules/
/vendor/
Gruntfile.js
20 changes: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"root": true,
"extends": [
"wikimedia/client",
"wikimedia/jquery",
"wikimedia/mediawiki"
],
"globals": {
"require": "readonly",
"module": "readonly"
},
"rules": {
"one-var": "off",
"//": [
"off",
"ResourceLoader's `packageFiles` do not require wrapping but the `module` option is only available in ES6+."
],
"no-implicit-globals": "off"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/lint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Installing PHP
uses: shivammathur/setup-php@master
with:
php-version: '7.4'
php-version: '8.0'
- name: Get Composer Cache Directory 2
id: composer-cache
run: |
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
.DS_Store
.svn
/vendor
composer.lock
/composer.lock
/node_modules
/.eslintcache
/package-lock.json
3 changes: 3 additions & 0 deletions EmbedVideo.i18n.magic.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

$magicWords['en'] = [
'ev' => [ 0, 'ev' ],
'evt' => [ 0, 'evt' ],
'evu' => [ 0, 'evu' ],
'evl' => [ 0, 'evl' ],
'vlink' => [ 0, 'vlink' ],
'ev_start' => [ 0, 'start=$1' ],
'ev_end' => [ 0, 'end=$1' ],
'cover' => [ 0, 'cover=$1' ],
Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,41 @@ Alternatively each parameter can be used in any order as a named parameter. The
**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}}`

### \#evu - Embed Video Url
The `{{#evu}}` parser function tries to extract the service from the host name of an url.

It takes the same arguments as `{{#ev}}`.

### \#evl - Embed Video Link
The support for `{{#evl}} / {{#vlink}}` and `<evlplayer> / <vplayer>` has been added with version 3.4.0.

The link parser function takes the following arguments:
* `id` - Video ID
* `text` - Link Text
* `player` - ID of the `<evlplayer>` if multiple exist on a page
* `service` - Name of the embed service, defaults to YouTube

Named arguments can be passed in any order, unnamed args must be passed in the order defined above.

#### \<evlplayer> / \<vplayer>
The corresponding player that plays the videos defined by `{{#evl}}` links.

Note that this implementation differs from EmbedVideo v2.x in the following areas:
* No `default content` is supported, i.e. text inside the tags
* A default video id should be defined, else the player displays a blank embed
* In the old implementation nothing was shown
* No `style` attribute can be set
* Video lists are not supported

### Example
```mediawiki
<evlplayer w="width" h="height" class="class" id="example-player" defaultid="pSsYTj9kCHE"></evlplayer>`
{{#evl:21X5lGlDOfg|NASA Live|player=example-player}}`
{{#evl:6ZFbXIJkuI1dVNWvzJzown|text=Spotify Track|service=spotifytrack|player=example-player}}
```

Shows a YouTube embed for the video `pSsYTj9kCHE` and two video links, one for another YouTube video (NASA Live) and a Spotify track.

## Examples

## SharePoint
Expand Down Expand Up @@ -228,6 +263,7 @@ As of version 3.x, EmbedVideo supports embedding video content from the followin
| Site | Service Name(s) | ID Example | URL Example(s) |
|----------------------------------------------------------|---------------------------------|--------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| [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 |
| [Bandcamp](https://bandcamp.com/) | `bandcamp` | 1003592798 | https://emptyhousesmusic.bandcamp.com/album/empty-houses (Click on share/embed, and copy the id after `album=`) |
| [Bilibili](https://www.bilibili.com/) | `bilibili` | BV1Hz4y1k7ae | https://player.bilibili.com/player.html?bvid=1Hz4y1k7ae&amp;page=1 |
| [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 |
| [KakaoTV](https://tv.kakao.com/) | `kakaotv` | 301157950 | https://play-tv.kakao.com/embed/player/cliplink/301157950 |
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starcitizenwiki/embedvideo",
"version": "3.3.0",
"version": "3.4.0",
"type": "mediawiki-extension",
"description": "Adds a parser function embedding video from popular sources.",
"license": "MIT",
Expand Down
62 changes: 53 additions & 9 deletions extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EmbedVideo",
"version": "3.3.0",
"version": "3.4.0",
"author": [
"[https://www.mediawiki.org/wiki/User:Octfx Octfx]",
"[https://www.mediawiki.org/wiki/User:Alistair3149 Alistair3149]",
Expand Down Expand Up @@ -35,15 +35,59 @@
"embedvideo": "MediaWiki\\Extension\\EmbedVideo\\ApiEmbedVideo"
},
"ResourceModules": {
"ext.embedVideo.messages": {
"messages": [
"embedvideo-service-archiveorg",
"embedvideo-service-bandcamp",
"embedvideo-service-bilibili",
"embedvideo-service-dailymotion",
"embedvideo-service-kakaotv",
"embedvideo-service-loom",
"embedvideo-service-navertv",
"embedvideo-service-niconico",
"embedvideo-service-soundcloud",
"embedvideo-service-sharepoint",
"embedvideo-service-spotify",
"embedvideo-service-twitch",
"embedvideo-service-videolink",
"embedvideo-service-vimeo",
"embedvideo-service-youtube",
"embedvideo-service-localvideo",
"embedvideo-service-externalvideo",
"embedvideo-consent-privacy-notice-text",
"embedvideo-consent-privacy-policy"
]
},
"ext.embedVideo.videolink": {
"es6": true,
"packageFiles": [
"ext.embedVideo.videolink.js",
{ "name": "fetchFactory.js", "file": "fetchers/fetchFactory.js" },
{ "name": "queryKeyParser.js", "file": "fetchers/queryKeyParser.js" },
{ "name": "bilibili.js", "file": "fetchers/bilibili.js" },
{ "name": "niconico.js", "file": "fetchers/niconico.js" },
{ "name": "oembed.js", "file": "fetchers/oembed.js" },
{ "name": "iframe.js", "file": "modules/iframe.js" }
],
"styles": [
"ext.embedVideo.consent.less"
],
"position": "top",
"targets": [
"desktop",
"mobile"
]
},
"ext.embedVideo.consent": {
"es6": true,
"packageFiles": [
"ext.embedVideo.consent.js",
{ "name": "fetchFactory.js", "file": "fetchers/fetchFactory.js" },
{ "name": "queryKeyParser.js", "file": "fetchers/queryKeyParser.js" },
{ "name": "bilibili.js", "file": "fetchers/bilibili.js" },
{ "name": "niconico.js", "file": "fetchers/niconico.js" },
{ "name": "oembed.js", "file": "fetchers/oembed.js" }
{ "name": "fetchFactory.js", "file": "fetchers/fetchFactory.js" },
{ "name": "queryKeyParser.js", "file": "fetchers/queryKeyParser.js" },
{ "name": "bilibili.js", "file": "fetchers/bilibili.js" },
{ "name": "niconico.js", "file": "fetchers/niconico.js" },
{ "name": "oembed.js", "file": "fetchers/oembed.js" },
{ "name": "iframe.js", "file": "modules/iframe.js" }
],
"styles": [
"ext.embedVideo.consent.less"
Expand Down Expand Up @@ -99,7 +143,7 @@
},
"EmbedVideoUseEmbedStyleForLocalVideos": {
"description": "Styles local videos like they are embedded",
"value": false
"value": true
},
"EmbedVideoEnableAudioHandler": {
"description": "Enables the audio handler which displays local videos using the html5 <audio> tag.",
Expand All @@ -126,11 +170,11 @@
"value": []
},
"EmbedVideoRequireConsent": {
"description": "Explicitly require consent by only loading the iframe if the user clicks it",
"description": "Explicitly require consent by only loading the iframe after the user clicks play",
"value": true
},
"EmbedVideoFetchExternalThumbnails": {
"description": "Don't try to fetch thumbnails when consent is required.",
"description": "Fetch video thumbnails by querying the respective external oembed endpoints. This results in a http call.",
"value": true
},
"EmbedVideoShowPrivacyNotice": {
Expand Down
6 changes: 3 additions & 3 deletions i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
},
"embedvideo-description": "Fügt eine Parserfunktion hinzu, mittels derer Videos populärer Dienste eingebettet werden können.",
"embedvideo-load": "$1 laden",
"embedvideo-type-audio": "audio",
"embedvideo-type-audio": "Audio",
"embedvideo-type-content": "Inhalt",
"embedvideo-type-video": "video",
"embedvideo-type-video": "Video",
"embedvideo-consent-privacy-policy": "Datenschutzrichtlinie",
"embedvideo-consent-privacy-notice-text": "$1 sammelt möglicherweise persönliche Daten.",
"embedvideo-consent-privacy-notice-continue": "Fortfahren",
Expand All @@ -31,7 +31,7 @@
"embedvideo-error-evp_deprecated": "Die Parserfunktion „#evp“ wurde in EmbedVideo 2.0 verworfen; alle Parserfunktionen-Tags sind in „#ev“ zu ändern.",
"embedvideo-error-container": "Der Wert für „container“ ist ungültig.",
"embedvideo-video-long-desc": "$1, $2 Codec, Länge $3, $4x$5 Pixel, $6 insgesamt",
"embedvideo-audio-long-desc": "$1, $2 codec, Länge $3, $4 insgesamt",
"embedvideo-audio-long-desc": "$1, $2 Codec, Länge $3, $4 insgesamt",
"embedvideo-error-cantdecode_evu": "Konnte das Video von $1 nicht analysieren",
"apihelp-embedvideo-summary": "Ermittelt den generierten Videoeinbettungscode für die angegebenen Parameter.",
"apihelp-embedvideo-param-service": "Name des Dienstes (youtube, twitch etc.)",
Expand Down
4 changes: 3 additions & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"embedvideo-consent-privacy-notice-dismiss": "Dismiss",
"embedvideo-service-archiveorg": "Archive.org",
"embedvideo-service-bilibili": "Bilibili",
"embedvideo-service-bandcamp": "Bandcamp",
"embedvideo-service-dailymotion": "Dailymotion",
"embedvideo-service-kakaotv": "KakaoTV",
"embedvideo-service-loom": "Loom",
Expand All @@ -22,10 +23,11 @@
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-spotify": "Spotify",
"embedvideo-service-twitch": "Twitch",
"embedvideo-service-videolink": "Video Link",
"embedvideo-service-vimeo": "Vimeo",
"embedvideo-service-youtube": "YouTube",
"embedvideo-service-localvideo": "Local File",
"embedvideo-service-externalvideo": "External Video ",
"embedvideo-service-externalvideo": "External Video",
"embedvideo-play": "Play Video",
"embedvideo-error-missingparams": "EmbedVideo is missing a required parameter.",
"embedvideo-error-service": "EmbedVideo does not recognize the video service \"$1\".",
Expand Down
1 change: 1 addition & 0 deletions i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"embedvideo-consent-privacy-notice-text": "$1 podría recabar datos personales.",
"embedvideo-consent-privacy-notice-continue": "Continuar",
"embedvideo-consent-privacy-notice-dismiss": "Descartar",
"embedvideo-service-videolink": "Enlace del video",
"embedvideo-service-externalvideo": "Video external",
"embedvideo-play": "Reproducir",
"embedvideo-error-missingparams": "EmbedVideo; falta un parámetro requerido.",
Expand Down
1 change: 1 addition & 0 deletions i18n/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"embedvideo-service-bilibili": "ביליבילי",
"embedvideo-service-spotify": "ספוטיפיי",
"embedvideo-service-twitch": "טוויטץ'",
"embedvideo-service-videolink": "קישור וידאו",
"embedvideo-service-vimeo": "וימאו",
"embedvideo-service-youtube": "יוטיוב",
"embedvideo-service-localvideo": "קובץ מקומי",
Expand Down
5 changes: 3 additions & 2 deletions i18n/ia.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"embedvideo-consent-privacy-notice-text": "$1 pote colliger datos personal.",
"embedvideo-consent-privacy-notice-continue": "Continuar",
"embedvideo-consent-privacy-notice-dismiss": "Clauder",
"embedvideo-service-videolink": "Ligamine video",
"embedvideo-service-localvideo": "File local",
"embedvideo-service-externalvideo": "Video externe",
"embedvideo-play": "Reproducer video",
Expand All @@ -27,8 +28,8 @@
"embedvideo-error-unknown": "EmbedVideo ha incontrate un error incognite durante le tentativa de generar iste bloco de incastration de video. ($1)",
"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.",
"embedvideo-error-container": "Le parametro fornite pro 'container' non es valide.",
"embedvideo-video-long-desc": "$1, codec $2, longitude $3, $4x$5 pixels, $6 in total",
"embedvideo-audio-long-desc": "$1, codec $2, longitude $3, $4 in total",
"embedvideo-video-long-desc": "$1, codec $2, longitude $3, $4 x $5 pixels, generalmente $6",
"embedvideo-audio-long-desc": "$1, codec $2, longitude $3, generalmente $4",
"embedvideo-error-cantdecode_evu": "Non poteva analysar video de $1",
"embedvideo-error-url-not-whitelisted": "Le URL fornite non es definite in $wgAllowExternalImagesFrom",
"apihelp-embedvideo-summary": "Obtener codice de incastration de video generate pro le parametros date.",
Expand Down
1 change: 1 addition & 0 deletions i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"embedvideo-service-soundcloud": "사운드 클라우드",
"embedvideo-service-spotify": "스포티파이",
"embedvideo-service-twitch": "트위치",
"embedvideo-service-videolink": "비디오 링크",
"embedvideo-service-vimeo": "비메오",
"embedvideo-service-youtube": "유튜브",
"embedvideo-service-localvideo": "로컬 파일",
Expand Down
1 change: 1 addition & 0 deletions i18n/lb.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"embedvideo-consent-privacy-policy": "Dateschutz",
"embedvideo-consent-privacy-notice-continue": "Virufueren",
"embedvideo-consent-privacy-notice-dismiss": "Verwerfen",
"embedvideo-service-videolink": "Videolink",
"embedvideo-service-localvideo": "Lokale Fichier",
"embedvideo-service-externalvideo": "Externe Video",
"embedvideo-play": "Video spillen",
Expand Down
1 change: 1 addition & 0 deletions i18n/mk.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"embedvideo-consent-privacy-notice-text": "$1 може да собира лични податоци.",
"embedvideo-consent-privacy-notice-continue": "Продолжи",
"embedvideo-consent-privacy-notice-dismiss": "Тргни",
"embedvideo-service-videolink": "Видеоврска",
"embedvideo-service-localvideo": "Месна податотека",
"embedvideo-service-externalvideo": "Надворешно видео",
"embedvideo-play": "Пушти видео",
Expand Down
1 change: 1 addition & 0 deletions i18n/skr-arab.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"embedvideo-consent-privacy-notice-continue": "جاری رکھو",
"embedvideo-consent-privacy-notice-dismiss": "مکاؤ",
"embedvideo-service-dailymotion": "ڈیلی موشن",
"embedvideo-service-videolink": "وڈیو لنک",
"embedvideo-service-vimeo": "ویمیو",
"embedvideo-service-youtube": "یوٹیوب",
"embedvideo-service-localvideo": "لوکیل فائل",
Expand Down
1 change: 1 addition & 0 deletions i18n/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"embedvideo-consent-privacy-notice-text": "$1 mogoče zbira osebne podatke.",
"embedvideo-consent-privacy-notice-continue": "Nadaljuj",
"embedvideo-consent-privacy-notice-dismiss": "Opusti",
"embedvideo-service-videolink": "Povezava na video",
"embedvideo-service-localvideo": "Lokalna datoteka",
"embedvideo-service-externalvideo": "Zunanji video",
"embedvideo-play": "Predvajaj video",
Expand Down
11 changes: 7 additions & 4 deletions i18n/zh-hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"authors": [
"Alistair3149",
"GuoPC",
"LittlePaw365",
"Zhang8569"
]
},
Expand All @@ -16,15 +17,17 @@
"embedvideo-consent-privacy-notice-continue": "继续",
"embedvideo-consent-privacy-notice-dismiss": "关闭",
"embedvideo-service-bilibili": "哔哩哔哩",
"embedvideo-service-localvideo": "本地文件",
"embedvideo-service-externalvideo": "外部视频",
"embedvideo-play": "播放视频",
"embedvideo-error-missingparams": "EmbedVideo缺少一个必须的参数。",
"embedvideo-error-service": "嵌入视频无法识别视频服务“$1”。",
"embedvideo-error-id": "视频嵌入收到了一个对服务“$1”不可用的id “$2“",
"embedvideo-error-width": "EmbedVideo收到了一个错误的高度参数“$1”",
"embedvideo-error-height": "EmbedVideo收到了一个错误的高度参数“$1”",
"embedvideo-error-alignment": "嵌入的视频被给予了对校准参数一个不可用的数值“$1”。可用的数值为“left”“center”或“right”。",
"embedvideo-error-valignment": "嵌入的视频被给予了对校准参数一个不可用的数值“$1”。可用的数值为“上”,“中间”,“下”,或“基线”。",
"embedvideo-error-urlargs": "嵌入视频接收到了一个涵盖出错方程和空白争论的URL争论列表",
"embedvideo-error-alignment": "EmbedVideo的对齐参数“$1”有非法值。有效值为“left”“center”或“right”。",
"embedvideo-error-valignment": "EmbedVideo的对齐参数“$1”有非法值。有效值为“top”“middle”“bottom”或“baseline”。",
"embedvideo-error-urlargs": "EmbedVideo收到的URL参数列表包含畸形数据或空参数",
"embedvideo-error-unknown": "EmbedVideo在尝试生成该视频嵌入块时遇到了一个未知的错误。($1)",
"embedvideo-error-evp_deprecated": "#evp解析器函数在EmbedVideo 2.0中已弃用。请将您的解析器函数标记转换为#ev。",
"embedvideo-error-container": "为‘集装箱’ 提供的参数为不可用的。",
Expand All @@ -37,7 +40,7 @@
"apihelp-embedvideo-param-dimensions": "一个数字宽度(100)或宽比高(100 x 100)",
"apihelp-embedvideo-param-alignment": "视频校准",
"apihelp-embedvideo-param-description": "视频描述",
"apihelp-embedvideo-param-container": "接受该框架,或留下空白",
"apihelp-embedvideo-param-container": "接受框架,或留空",
"apihelp-embedvideo-param-urlargs": "视频URL中额外需要通过的争论(对于部分服务)",
"apihelp-embedvideo-param-autoresize": "自动调整视频大小?(是或否)"
}
Loading

0 comments on commit 41d6c49

Please sign in to comment.