maotai
This commit is contained in:
@@ -67,14 +67,22 @@ class VideoInfoPage extends BasePage
|
||||
if (empty($this->arrVideo)) {
|
||||
|
||||
$arrVideo = json_decode($this->getContent(), true);
|
||||
// $arrVideo = $arrVideo['list'][0]; // 这个日志会报错
|
||||
$arrVideo = $arrVideo['list'][0] ?? [];
|
||||
|
||||
$arrVideo = $arrVideo['list'][0];
|
||||
|
||||
// print_r($arrVideo);
|
||||
|
||||
$strPlayUrl = $arrVideo['vod_play_url'];
|
||||
$arrVideo = $arrVideo['list'][0] ?? [];
|
||||
// 如果结构不正确 → 返回空数组
|
||||
if (!$arrVideo) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 2. 检查播放地址
|
||||
$strPlayUrl = $arrVideo['vod_play_url'] ?? null;
|
||||
|
||||
// 2. 判断是否有播放地址
|
||||
if (empty($arrVideo['vod_play_url'])) {
|
||||
// 无播放地址 → 丢弃该数据
|
||||
return [];
|
||||
}
|
||||
|
||||
unset($arrVideo['vod_play_url']);
|
||||
|
||||
$arrPlayUrl = str_replace('#', '$', $strPlayUrl);
|
||||
|
||||
Reference in New Issue
Block a user