Skip to content

Commit

Permalink
bug fixes #78
Browse files Browse the repository at this point in the history
  • Loading branch information
aminyazdanpanah committed Oct 25, 2020
1 parent 46cf59b commit e8f27fe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/HLSPlaylist.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ private function getAudioBitrate(Representation $rep): int
private function getOriginalAudioBitrate(): int
{
try {
return $this->hls
->getMedia()
->getStreams()
->audios()
->first()
->get('bit_rate', static::DEFAULT_AUDIO_BITRATE);
$audios = $this->hls->getMedia()->getStreams()->audios();

if (!$audios->count()){
return static::DEFAULT_AUDIO_BITRATE;
}

return $audios->first()->get('bit_rate', static::DEFAULT_AUDIO_BITRATE);
} catch (ExceptionInterface $e) {
return static::DEFAULT_AUDIO_BITRATE;
}
Expand Down

0 comments on commit e8f27fe

Please sign in to comment.