mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-26 12:23:06 +08:00
35 lines
628 B
PHP
35 lines
628 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use App\Repos\Chapter as ChapterRepo;
|
|
|
|
class ChapterVod extends Service
|
|
{
|
|
|
|
public function getVodFiles($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;
|
|
}
|
|
|
|
}
|