0

I'm streaming an m3u8 live stream from AWS cloud front distribution. What happens is the player stops playing after a certain time i:e; the video segments which are processed are able to play while the other segments which are processed in the backend are not updating to the stream URL.So it is a responsibility of the player to retrieve the latest segments of the video from a CloudFront distribution or the CloudFront distribution should be able to push the latest segments to the stream URL? I'm using videogular2 for viewing the live stream video.

Steps involving at Backend

  1. downloading video for every 30sec from live Streaming and changing video into hls format(m3u8) using ffmpeg tool.
  2. so that ffmpeg generating 1 m3u8 and multiple ts files .
  3. merging m3u8 files into the master m3u8 file and uploading ts files and updating master m3u8 file into the s3 bucket.
  4. serving hls format file of s3 bucket through Cloudfront and displaying video in videogular player.

my issue is...

videogular not updating the m3u8 file on its own. I need to reload the page to refresh the m3u8 file then video playing from start

please can anyone suggest me a solution

  • Both videogular and CloudFront can't help you in this case, You can set cache-control = max-age to minimum value such as 3,5 or 10 seconds depends on how many TS segments are you inserting and the time of these TS segments and you need to make sure that the m3u8 is updating in the origin so CloudFront fetches it, it gets the latest one all the time, e.g: AWS has product called Mediapackage which does it. – James Dean Nov 05 '19 at 12:23
  • @james Thanks for the response,so cache-control means browser property or AWS CloudFront property? and why don't we update master m3u8 from videogular – vinod kumar Nov 05 '19 at 12:58
  • 1
    Both browser and CloudFront looks at the cache-control header, doing this, Player will load the m3u8 again once the max-age expires and you don't need to refresh it manually. – James Dean Nov 05 '19 at 14:14

0 Answers0