Commit 05dc7e13 authored by Mark Harding's avatar Mark Harding

(fix): legacy with new transcoder

1 merge request!414WIP: New transcoder
Pipeline #102335124 failed with stages
in 59 seconds
......@@ -9,8 +9,7 @@ namespace Minds\Controllers\api\v2\media;
use Minds\Api\Factory;
use Minds\Core\Di\Di;
use Minds\Core\Media\Proxy\Download;
use Minds\Core\Media\Proxy\Resize;
use Minds\Core\Media\Video\Transcoder\TranscodeStates;
use Minds\Interfaces;
class video implements Interfaces\Api, Interfaces\ApiIgnorePam
......@@ -27,11 +26,18 @@ class video implements Interfaces\Api, Interfaces\ApiIgnorePam
$video = $videoManager->get($pages[0]);
$sources = $videoManager->getSources($video);
$status = $transcodeStates->getStatus($video); // Currently not efficient as no caching
if ($status === TranscodeStates::FAILED && count($sources)) {
$status = TranscodeStates::COMPLETED;
}
Factory::response([
'entity' => $video->export(),
'sources' => Factory::exportable($videoManager->getSources($video)),
'sources' => Factory::exportable($sources),
'poster' => $video->getIconUrl(),
'transcode_status' => $transcodeStates->getStatus($video), // Currently not efficient as no caching
'transcode_status' => $status,
]);
}
......
......@@ -89,7 +89,8 @@ class Manager
->setLabel($transcode->getProfile()->getId())
->setSize($transcode->getProfile()->getHeight())
->setSrc(implode('/', [
$this->config->get('transcoder')['cdn_url'] ?? 'https://cdn-cinemr.minds.com/cinemr_dev',
$this->config->get('transcoder')['cdn_url'] ?? 'https://cdn-cinemr.minds.com',
$this->config->get('transcoder')['dir'],
$transcode->getGuid(),
$transcode->getProfile()->getStorageName()
]));
......
Please register or to comment