adds peertube api request

This commit is contained in:
buttle 2021-04-09 18:25:28 +02:00
parent d25dbea8d0
commit 52976f416d
2 changed files with 4 additions and 2 deletions

View File

@ -64,6 +64,8 @@ class PeertubeMediaIngester implements IngesterInterface
} }
// Set the Media source and data. // Set the Media source and data.
$media->setSource($url); $media->setSource($url);
$media->setData(json_decode($response->getBody(), true)); $media_data = json_decode($response->getBody());
$media_data->embedPath = $base_url . $media_data->embedPath;
$media->setData($media_data, true);
} }
} }

View File

@ -11,7 +11,7 @@ class PeertubeMediaRenderer implements RendererInterface
MediaRepresentation $media, MediaRepresentation $media,
array $options = []) array $options = [])
{ {
$url = str_replace('watch', 'embed', $media->source()); $url = $media->mediaData()['embedPath'];
if (parse_url($url, PHP_URL_QUERY)) { if (parse_url($url, PHP_URL_QUERY)) {
$url .= '&peertubeLink=0'; $url .= '&peertubeLink=0';
} else { } else {