Skip to content

Commit

Permalink
Add method to get a Video HLS stream file
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubz committed Sep 22, 2020
1 parent b92cc9d commit e745c1d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/LiveStream/LiveStream.php
Expand Up @@ -427,6 +427,23 @@ public function getLiveVideo(
return $video;
}

/**
* Gets contents of a Video's HLS stream (m3u8) file.
*
* Requires a secure access token.
*
* @param \LiveStream\Resources\Video $video
*
* @return string|null
* @throws \LiveStream\Exceptions\LiveStreamException
*/
public function getVideoHlsFile(Video $video): ?string {
if (!$video->m3u8) return null;

$endpoint = substr($video->m3u8, strlen(self::BASE_URL));
return $this->request($endpoint);
}

/**
* Refreshes a secure access token if invalid (5 minute life time).
*
Expand Down

0 comments on commit e745c1d

Please sign in to comment.