Skip to content

Commit

Permalink
#1306 videoHandler 에서 video 를 찾지 못할 경우 예외 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
akasima committed Aug 5, 2021
1 parent 3c81ad6 commit cd350c9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/src/Xpressengine/Media/Handlers/VideoHandler.php
Expand Up @@ -149,6 +149,10 @@ protected function extractInformation(Video $video)

$tmpFile->destroy();

if (! array_key_exists('video', $info)) {
$info['video'] = [];
}

if (! array_key_exists('audio', $info)) {
$info['audio'] = [];
}
Expand All @@ -157,6 +161,14 @@ protected function extractInformation(Video $video)
unset($info['audio']['streams']);
}

if (isset($info['playtime_seconds']) == false) {
$info['playtime_seconds'] = 60;
}

if (isset($info['bitrate']) == false) {
$info['bitrate'] = 128000;
}

return [$info['audio'], $info['video'], $info['playtime_seconds'], $info['bitrate']];
}

Expand Down

0 comments on commit cd350c9

Please sign in to comment.