Skip to content

Commit

Permalink
Merge branch 'release/v3.2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
octfx committed Aug 7, 2023
2 parents 9e82305 + 3949035 commit 9ee8052
Show file tree
Hide file tree
Showing 22 changed files with 387 additions and 133 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Downloadable archive packages for numbered releases will also be available from
1. Download the contents of the extension, as outlined above.
2. Create an EmbedVideo folder in the extensions/ folder of your MediaWiki installation.
3. Copy the contents of this distribution into that folder
4. Install FFmpeg, when using the local video handler (enabled by default)

Add the following line to your LocalSettings.php:

Expand Down Expand Up @@ -151,6 +152,9 @@ E.g. using named id and unnamed description `{{#ev:service||||This is the Descri

## Examples

## SharePoint
For more information on SharePoint embeds see [Issue #60](https://github.com/StarCitizenWiki/mediawiki-extensions-EmbedVideo/issues/60#issuecomment-1641493146).

### YouTube Examples

#### YouTube Example #1
Expand Down Expand Up @@ -225,9 +229,12 @@ As of version 3.x, EmbedVideo supports embedding video content from the followin
|----------------------------------------------------------|---------------------------------|--------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| [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 |
| [Bilibili](https://www.bilibili.com/) | `bilibili` | BV1Hz4y1k7ae | https://player.bilibili.com/player.html?bvid=1Hz4y1k7ae&amp;page=1 |
| [KakaoTV](https://tv.kakao.com/) | `kakaotv` | 301157950 | https://play-tv.kakao.com/embed/player/cliplink/301157950 |
| [NaverTV](https://tv.naver.com/) | `navertv` | 27831593 | https://tv.naver.com/embed/27831593 |
| [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 |
| [Loom](https://www.loom.com/) | `loom` | e5b8c04bca094dd8a5507925ab887002 | https://www.loom.com/share/e5b8c04bca094dd8a5507925ab887002 |
| [NaverTV](https://tv.naver.com/) | `navertv` | 27831593 | https://tv.naver.com/embed/27831593 |
| [Niconico](http://nicovideo.jp/) | `niconico` | sm40807360 | https://embed.nicovideo.jp/watch/sm40807360 |
| SharePoint | `sharepoint` | Not Applicable | https://[SUB].sharepoint.com/sites/[PATH]/_layouts/15/embed.aspx?UniqueId=[ID]&embed=[...] |
| [SoundCloud](http://soundcloud.com/) | `soundcloud` | | https://soundcloud.com/skrillex/skrillex-rick-ross-purple-lamborghini |
| [Spotify](http://spotify.com/) | `spotifyalbum` - Art embed | 3B61kSKTxlY36cYgzvf3cP | https://open.spotify.com/album/3B61kSKTxlY36cYgzvf3cP |
| [Spotify](http://spotify.com/) | `spotifyartist` - Artist embed | 0YC192cP3KPCRWx8zr8MfZ | https://open.spotify.com/artist/0YC192cP3KPCRWx8zr8MfZ |
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.2.7",
"version": "3.2.8",
"type": "mediawiki-extension",
"description": "Adds a parser function embedding video from popular sources.",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EmbedVideo",
"version": "3.2.7",
"version": "3.2.8",
"author": [
"[https://www.mediawiki.org/wiki/User:Octfx Octfx]",
"[https://www.mediawiki.org/wiki/User:Alistair3149 Alistair3149]",
Expand All @@ -14,7 +14,7 @@
"license-name": "MIT",
"type": "parserhook",
"requires": {
"MediaWiki": ">= 1.35.0",
"MediaWiki": ">= 1.37.0",
"platform": {
"php": ">=7.3.0",
"ext-curl": "*"
Expand Down
2 changes: 2 additions & 0 deletions i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
"embedvideo-service-archiveorg": "Archiv.org",
"embedvideo-service-bilibili": "Bilibili",
"embedvideo-service-kakaotv": "KakaoTV",
"embedvideo-service-loom": "Loom",
"embedvideo-service-navertv": "NaverTV",
"embedvideo-service-niconico": "Niconico",
"embedvideo-service-soundcloud": "SoundCloud",
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-spotify": "Spotify",
"embedvideo-service-twitch": "Twitch",
"embedvideo-service-vimeo": "Vimeo",
Expand Down
3 changes: 3 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
"embedvideo-consent-privacy-notice-dismiss": "Dismiss",
"embedvideo-service-archiveorg": "Archive.org",
"embedvideo-service-bilibili": "Bilibili",
"embedvideo-service-dailymotion": "Dailymotion",
"embedvideo-service-kakaotv": "KakaoTV",
"embedvideo-service-loom": "Loom",
"embedvideo-service-navertv": "NaverTV",
"embedvideo-service-niconico": "Niconico",
"embedvideo-service-soundcloud": "SoundCloud",
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-spotify": "Spotify",
"embedvideo-service-twitch": "Twitch",
"embedvideo-service-vimeo": "Vimeo",
Expand Down
3 changes: 3 additions & 0 deletions i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
"embedvideo-consent-privacy-notice-dismiss": "Ignorer",
"embedvideo-service-archiveorg": "Archive.org",
"embedvideo-service-bilibili": "Bilibili",
"embedvideo-service-dailymotion": "Dailymotion",
"embedvideo-service-kakaotv": "KakaoTV",
"embedvideo-service-loom": "Loom",
"embedvideo-service-navertv": "NaverTV",
"embedvideo-service-niconico": "Niconico",
"embedvideo-service-soundcloud": "SoundCloud",
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-spotify": "Spotify",
"embedvideo-service-twitch": "Twitch",
"embedvideo-service-vimeo": "Vimeo",
Expand Down
3 changes: 3 additions & 0 deletions i18n/ia.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"embedvideo-consent-privacy-notice-dismiss": "Clauder",
"embedvideo-service-archiveorg": "Archive.org",
"embedvideo-service-bilibili": "Bilibili",
"embedvideo-service-dailymotion": "Dailymotion",
"embedvideo-service-kakaotv": "KakaoTV",
"embedvideo-service-loom": "Loom",
"embedvideo-service-navertv": "NaverTV",
"embedvideo-service-niconico": "Niconico",
"embedvideo-service-soundcloud": "SoundCloud",
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-spotify": "Spotify",
"embedvideo-service-twitch": "Twitch",
"embedvideo-service-vimeo": "Vimeo",
Expand Down
2 changes: 2 additions & 0 deletions i18n/lb.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"embedvideo-consent-privacy-notice-continue": "Virufueren",
"embedvideo-consent-privacy-notice-dismiss": "Verwerfen",
"embedvideo-service-bilibili": "Bilibili",
"embedvideo-service-dailymotion": "Dailymotion",
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-fauxembedservice": "Lokale Fichier",
"embedvideo-play": "Video spillen",
"embedvideo-error-cantdecode_evu": "Konnt de Video vun $1 net analyséieren",
Expand Down
3 changes: 3 additions & 0 deletions i18n/mk.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"embedvideo-consent-privacy-notice-dismiss": "Тргни",
"embedvideo-service-archiveorg": "Archive.org",
"embedvideo-service-bilibili": "Bilibili",
"embedvideo-service-dailymotion": "Dailymotion",
"embedvideo-service-kakaotv": "KakaoTV",
"embedvideo-service-loom": "Loom",
"embedvideo-service-navertv": "NaverTV",
"embedvideo-service-niconico": "Niconico",
"embedvideo-service-soundcloud": "SoundCloud",
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-spotify": "Spotify",
"embedvideo-service-twitch": "Twitch",
"embedvideo-service-vimeo": "Vimeo",
Expand Down
2 changes: 2 additions & 0 deletions i18n/qqq.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
"@metadata": {
"authors": [
"Amire80",
"McDutchie",
"Robby"
]
},
"embedvideo-consent-privacy-notice-continue": "{{identical|Continue}}",
"embedvideo-consent-privacy-notice-dismiss": "{{identical|Dismiss}}",
"embedvideo-service-archiveorg": "{{Optional}}",
"embedvideo-service-bilibili": "{{Optional}}",
"embedvideo-service-dailymotion": "Name of Dailymotion video streaming service, see https://www.dailymotion.com",
"embedvideo-service-kakaotv": "{{Optional}}",
"embedvideo-service-navertv": "{{Optional}}",
"embedvideo-service-niconico": "{{Optional}}",
Expand Down
2 changes: 1 addition & 1 deletion i18n/sh.json → i18n/sh-latn.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"@metadata": {
"authors": [
"Vlad5250"
"Winston Sung"
]
},
"embedvideo-type-audio": "zvuk",
Expand Down
3 changes: 3 additions & 0 deletions i18n/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"embedvideo-consent-privacy-notice-dismiss": "Opusti",
"embedvideo-service-archiveorg": "Archive.org",
"embedvideo-service-bilibili": "Bilibili",
"embedvideo-service-dailymotion": "Dailymotion",
"embedvideo-service-kakaotv": "KakaoTV",
"embedvideo-service-loom": "Loom",
"embedvideo-service-navertv": "NaverTV",
"embedvideo-service-niconico": "Niconico",
"embedvideo-service-soundcloud": "SoundCloud",
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-spotify": "Spotify",
"embedvideo-service-twitch": "Twitch",
"embedvideo-service-vimeo": "Vimeo",
Expand Down
3 changes: 3 additions & 0 deletions i18n/zh-hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
"embedvideo-consent-privacy-notice-dismiss": "關閉",
"embedvideo-service-archiveorg": "Archive.org",
"embedvideo-service-bilibili": "嗶哩嗶哩",
"embedvideo-service-dailymotion": "Dailymotion",
"embedvideo-service-kakaotv": "KakaoTV",
"embedvideo-service-loom": "Loom",
"embedvideo-service-navertv": "NaverTV",
"embedvideo-service-niconico": "Niconico",
"embedvideo-service-soundcloud": "SoundCloud",
"embedvideo-service-sharepoint": "SharePoint",
"embedvideo-service-spotify": "Spotify",
"embedvideo-service-twitch": "Twitch",
"embedvideo-service-vimeo": "Vimeo",
Expand Down
76 changes: 76 additions & 0 deletions includes/EmbedService/DailyMotion.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

declare( strict_types=1 );

namespace MediaWiki\Extension\EmbedVideo\EmbedService;

final class DailyMotion extends AbstractEmbedService {
/**
* @inheritDoc
*/
public function getBaseUrl(): string {
return '//www.dailymotion.com/embed/video/%1$s';
}

/**
* @inheritDoc
*/
public function getAspectRatio(): ?float {
return 16 / 9;
}

/**
* @inheritDoc
*/
public function getDefaultWidth(): int {
return 640;
}

/**
* @inheritDoc
*/
public function getDefaultHeight(): int {
return 360;
}

/**
* @inheritDoc
*/
protected function getUrlRegex(): array {
return [
'#dailymotion\.com/(?:video|embed/video)/([a-zA-Z0-9]+)(?:_\S+?)?#is',
];
}

/**
* @inheritDoc
*/
protected function getIdRegex(): array {
return [
'#^([a-zA-Z0-9]+)(?:_\S+?)?#is',
];
}

/**
* @inheritDoc
*/
public function getContentType(): ?string {
return 'video';
}

/**
* @inheritDoc
*/
public function getPrivacyPolicyUrl(): ?string {
return 'https://www.dailymotion.com/legal/privacy?localization=en';
}

/**
* @inheritDoc
*/
public function getCSPUrls(): array {
return [
'https://dailymotion.com',
];
}
}
22 changes: 17 additions & 5 deletions includes/EmbedService/EmbedServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ final class EmbedServiceFactory {
private static $availableServices = [
ArchiveOrg::class,
Bilibili::class,
Niconico::class,
NaverTV::class,
DailyMotion::class,
KakaoTV::class,
Loom::class,
NaverTV::class,
Niconico::class,
SharePoint::class,
SoundCloud::class,
SpotifyAlbum::class,
SpotifyArtist::class,
Expand All @@ -37,8 +40,8 @@ final class EmbedServiceFactory {
TwitchClip::class,
TwitchVod::class,
Vimeo::class,
YouTubeOEmbed::class,
YouTube::class,
YouTubeOEmbed::class,
YouTubePlaylist::class,
YouTubeVideoList::class,
];
Expand All @@ -57,15 +60,24 @@ public static function newFromName( string $serviceName, string $id ): AbstractE
case 'bilibili':
return new Bilibili( $id );

case 'dailymotion':
return new DailyMotion( $id );

case 'kakaotv':
return new KakaoTV( $id );

case 'loom':
return new Loom( $id );

case 'nicovideo':
case 'niconico':
return new Niconico( $id );

case 'navertv':
return new NaverTV( $id );

case 'kakaotv':
return new KakaoTV( $id );
case 'sharepoint':
return new SharePoint( $id );

case 'soundcloud':
return new SoundCloud( $id );
Expand Down
76 changes: 76 additions & 0 deletions includes/EmbedService/Loom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

declare( strict_types=1 );

namespace MediaWiki\Extension\EmbedVideo\EmbedService;

final class Loom extends AbstractEmbedService {
/**
* @inheritDoc
*/
public function getBaseUrl(): string {
return '//www.loom.com/embed/%1$s';
}

/**
* @inheritDoc
*/
public function getAspectRatio(): ?float {
return 16 / 9;
}

/**
* @inheritDoc
*/
public function getDefaultWidth(): int {
return 640;
}

/**
* @inheritDoc
*/
public function getDefaultHeight(): int {
return 360;
}

/**
* @inheritDoc
*/
protected function getUrlRegex(): array {
return [
'#www\.loom\.com\/(?:embed|share)\/([a-z0-9]{32})#is',
];
}

/**
* @inheritDoc
*/
protected function getIdRegex(): array {
return [
'#^([a-z0-9]{32})$#is',
];
}

/**
* @inheritDoc
*/
public function getContentType(): ?string {
return 'video';
}

/**
* @inheritDoc
*/
public function getPrivacyPolicyUrl(): ?string {
return 'https://www.loom.com/privacy-policy';
}

/**
* @inheritDoc
*/
public function getCSPUrls(): array {
return [
'https://www.loom.com',
];
}
}
Loading

0 comments on commit 9ee8052

Please sign in to comment.