1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-26 20:52:44 +08:00
2020-03-16 15:33:36 +08:00

35 lines
628 B
PHP

<?php
namespace App\Services;
use App\Repos\Chapter as ChapterRepo;
class ChapterVod extends Service
{
public function getPlayUrls($chapterId)
{
$chapterRepo = new ChapterRepo();
$vod = $chapterRepo->findChapterVod($chapterId);
if (empty($vod->file_transcode)) {
return [];
}
/**
* @var array $transcode
*/
$transcode = $vod->file_transcode;
$vod = new Vod();
foreach ($transcode as $key => $file) {
$transcode[$key]['url'] = $vod->getPlayUrl($file['url']);
}
return $transcode;
}
}