forked from leftypol/leftypol
config.php: add WIP embedding_2
This commit is contained in:
parent
698451a6d5
commit
4850a8ddd3
1 changed files with 30 additions and 0 deletions
|
@ -1265,6 +1265,36 @@
|
||||||
$config['embed_width'] = 300;
|
$config['embed_width'] = 300;
|
||||||
$config['embed_height'] = 246;
|
$config['embed_height'] = 246;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replacement parameters:
|
||||||
|
* - $1-$N: matched arguments from 'match_regex'.
|
||||||
|
* - %%thumbnail_path%%: Path to the downloaded thumbnail.
|
||||||
|
*/
|
||||||
|
$config['embedding_2'] = [
|
||||||
|
[
|
||||||
|
'match_regex' => '/^(?:(?:https?:)?\/\/)?((?:www|m)\.)?(?:(?:youtube(?:-nocookie)?\.com|youtu\.be))(?:\/(?:[\w\-]+\?v=|embed\/|live\/|v\/)?)([\w\-]{11})((?:\?|\&)\S+)?$/i',
|
||||||
|
'type' => 'regex',
|
||||||
|
'thumbnail_url' => 'https://img.youtube.com/vi/$2/0.jpg',
|
||||||
|
'html' => '<div class="video-container" data-video-id="$2" data-iframe-width="360" data-iframe-height="202">
|
||||||
|
<a href="https://youtu.be/$2" target="_blank" class="file">
|
||||||
|
<img style="width:360px;height:202px;object-fit:cover" src="%%thumbnail_path%%" class="post-image"/>
|
||||||
|
</a>
|
||||||
|
</div>'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'match_regex' => '/^https?:\/\/(\w+\.)?tiktok\.com\/@[a-z0-9\-_]+\/video\/([0-9]+)\?.*$/i',
|
||||||
|
'type' => 'oembed',
|
||||||
|
'provider' => 'https://www.youtube.com/oembed',
|
||||||
|
'thumb_width' => 288,
|
||||||
|
'thumb_height' => 512,
|
||||||
|
'html' => '<div class="tiktok-embed">
|
||||||
|
<a href="%%embed_url%%" target="_blank" class="file">
|
||||||
|
<img style="width:360px;height:202px;object-fit:cover" src="%%thumbnail_path%%" class="post-image"/>
|
||||||
|
</a>
|
||||||
|
</div>'
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ====================
|
* ====================
|
||||||
* Error messages
|
* Error messages
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue