Skip to content

Video module overview

Video Streaming

We're using Coconut to transcode our videos into multiple formats and resolutions, including HLS (HTTP Live-Streaming). The transcoded videos are stored in the idf--video-processed S3 bucket. The transcoded videos are served via a CloudFront distribution (Private CDN (Videos)) that points to the idf--video-processed S3 bucket.

Important Security Note

For video streaming to work, hls first loads a master.m3u8 file, which is a playlist (metadata) for all streams. It will then request individual stream.m3u8 files to load each stream. The streams http files are media.ts files which are then loaded.

Our Cloudfront distribution is private, meaning that we should request signed URLs for all files. There’s no issue for the master.m3u8 file since we request a signed URL from the BE. For other files however, we need a custom loader to request signed URLs, which is pretty difficult to implement atm.

As a work-around, two custom behaviors were added to our Cloudfront distribution, making the stream.m3u8 and media.ts files public, meaning that we only need signed URLs for the master.m3u8. It will give us some protection, since people can’t directly request the master, but we don’t have security in depth.