mirror of
https://github.com/friendica/friendica
synced 2025-04-28 01:10:12 +00:00
Preview for Videos and images / Video resolution selection
This commit is contained in:
parent
909e029168
commit
3d64c3031b
9 changed files with 62 additions and 35 deletions
|
@ -1268,14 +1268,6 @@ class Receiver
|
|||
} elseif ($filetype == 'video') {
|
||||
$height = (int)JsonLD::fetchElement($url, 'as:height', '@value');
|
||||
$size = (int)JsonLD::fetchElement($url, 'pt:size', '@value');
|
||||
|
||||
// We save bandwidth by using a moderate height (alt least 480 pixel height)
|
||||
// Peertube normally uses these heights: 240, 360, 480, 720, 1080
|
||||
if (!empty($attachments[$filetype]['height']) &&
|
||||
($height > $attachments[$filetype]['height']) && ($attachments[$filetype]['height'] >= 480)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$attachments[$filetype] = ['type' => $mediatype, 'url' => $href, 'height' => $height, 'size' => $size];
|
||||
} elseif (in_array($mediatype, ['application/x-bittorrent', 'application/x-bittorrent;x-scheme-handler/magnet'])) {
|
||||
$height = (int)JsonLD::fetchElement($url, 'as:height', '@value');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue