2022-01-30 18:02:52 -05:00
|
|
|
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
use App\Helpers\ErrorHandler;
|
|
|
|
use App\Helpers\Misc;
|
2022-02-13 16:21:08 -05:00
|
|
|
use App\Models\FeedTemplate;
|
2022-01-30 18:02:52 -05:00
|
|
|
|
|
|
|
class VideoController {
|
|
|
|
static public function get(string $video_id) {
|
|
|
|
$api = Misc::api();
|
|
|
|
$item = $api->getVideoByID($video_id);
|
|
|
|
if ($item->meta->success) {
|
|
|
|
$latte = Misc::latte();
|
2022-02-13 16:21:08 -05:00
|
|
|
$latte->render(Misc::getView('video'), new FeedTemplate($item->info->detail->nickname, $item));
|
2022-01-30 18:02:52 -05:00
|
|
|
} else {
|
|
|
|
ErrorHandler::show($item->meta);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|