|
|
@ -745,33 +745,40 @@ Class SiteController extends Controller { |
|
|
|
|
|
|
|
|
|
|
|
$cateId = $this->get('pid', ''); |
|
|
|
$cateId = $this->get('pid', ''); |
|
|
|
$cacheParentDataId = $this->get('cid', ''); |
|
|
|
$cacheParentDataId = $this->get('cid', ''); |
|
|
|
$page = $this->get('page', 1); |
|
|
|
$page = $this->get('page', 0); |
|
|
|
$pageSize = $this->get('limit', 100); |
|
|
|
$pageSize = $this->get('limit', 100); |
|
|
|
|
|
|
|
|
|
|
|
if (empty($videoUrl) || empty($videoId) || empty($cateId) || empty($cacheParentDataId)) { |
|
|
|
//增加按年、月查看视频自动播放更多视频支持 |
|
|
|
|
|
|
|
$para_year = $this->get('year', ''); |
|
|
|
|
|
|
|
$para_month = $this->get('month', ''); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($videoUrl) || empty($videoId) || empty($cateId)) { |
|
|
|
throw new Exception("缺少参数!", 403); |
|
|
|
throw new Exception("缺少参数!", 403); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$arr = parse_url($videoUrl); |
|
|
|
$arr = parse_url($videoUrl); |
|
|
|
$videoFilename = basename($arr['path']); |
|
|
|
$videoFilename = basename($arr['path']); |
|
|
|
|
|
|
|
|
|
|
|
//增加文件后缀格式检查,区分:mp4, mov, m3u8 |
|
|
|
//增加文件后缀格式检查,区分:mp4, mov, m3u8, mp3 |
|
|
|
$videoExtension = pathinfo($arr['path'], PATHINFO_EXTENSION); |
|
|
|
$videoExtension = pathinfo($arr['path'], PATHINFO_EXTENSION); |
|
|
|
$videoSourceType = Html::getMediaSourceType($videoExtension); |
|
|
|
$videoSourceType = Html::getMediaSourceType($videoExtension); |
|
|
|
|
|
|
|
|
|
|
|
//从缓存数据获取封面图 |
|
|
|
//从缓存数据获取封面图 |
|
|
|
$poster = '/img/beauty/audio_bg.jpg'; |
|
|
|
$poster = '/img/beauty/audio_bg.jpg'; |
|
|
|
$cacheSeconds = 86400; |
|
|
|
$cacheSeconds = 86400; |
|
|
|
$cachedParentData = Common::getCacheFromFile($cacheParentDataId, $cacheSeconds); |
|
|
|
|
|
|
|
if (!empty($cachedParentData)) { |
|
|
|
if (!empty($cacheParentDataId)) { |
|
|
|
$mp3 = $cachedParentData[$videoId]; |
|
|
|
$cachedParentData = Common::getCacheFromFile($cacheParentDataId, $cacheSeconds); |
|
|
|
if (!empty($mp3['snapshot'])) { |
|
|
|
if (!empty($cachedParentData)) { |
|
|
|
$poster = $mp3['snapshot']; |
|
|
|
$mp3 = $cachedParentData[$videoId]; |
|
|
|
}else { |
|
|
|
if (!empty($mp3['snapshot'])) { |
|
|
|
$imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif'); |
|
|
|
$poster = $mp3['snapshot']; |
|
|
|
$matchedImage = Html::searchImageByFilename($mp3['filename'], $cachedParentData, $imgExts); |
|
|
|
}else { |
|
|
|
if (!empty($matchedImage)) { |
|
|
|
$imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif'); |
|
|
|
$poster = $matchedImage['path']; |
|
|
|
$matchedImage = Html::searchImageByFilename($mp3['filename'], $cachedParentData, $imgExts); |
|
|
|
|
|
|
|
if (!empty($matchedImage)) { |
|
|
|
|
|
|
|
$poster = $matchedImage['path']; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -797,7 +804,8 @@ Class SiteController extends Controller { |
|
|
|
$params = compact( |
|
|
|
$params = compact( |
|
|
|
'videoUrl', 'videoId', 'videoFilename', |
|
|
|
'videoUrl', 'videoId', 'videoFilename', |
|
|
|
'cateId', 'cacheParentDataId', 'page', 'pageSize', |
|
|
|
'cateId', 'cacheParentDataId', 'page', 'pageSize', |
|
|
|
'copyright', 'isAdminIp', 'videoExtension', 'videoSourceType', 'poster' |
|
|
|
'copyright', 'isAdminIp', 'videoExtension', 'videoSourceType', 'poster', |
|
|
|
|
|
|
|
'para_year', 'para_month' |
|
|
|
); |
|
|
|
); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
} |
|
|
|
} |
|
|
|