Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
There are a number of use cases where HLS manifest manipulation techniques are applicable. Multi CDN switching, server-side ad insertion, looping or truncating a VOD, to mention a few. The fundamental principle is that you need some HLS proxy between the video player and the original HLS you wish to modify somehow. As this is a very common component in all these use cases we have developed and open sourced an NPM library, hls-proxy, that takes care of that. In this post we will describe how to use it and examples of some use cases.
The proxy server is built on fastify.io.
This handler is called after the proxy has fetched the master manifest from the origin. It provides the original request received by the proxy, base URL set by the originHandler and a parsed M3U object (@eyevinn/m3u8). It is expected to return an HLS master manifest.
In addition to the HLS proxy library this example uses an HLS manifest manipulation library that creates a new HLS VOD by repeating the contents of another HLS VOD.