TL;DR

We'll add real multi-CDN failover to an HLS stream without any client-side URL-rewriting hacks. You'll author a multivariant playlist with two pathways, build a ~40-line Express steering server that returns a JSON steering manifest, point hls.js at it, then flip CDN priority live and watch the player reroute with no reload and no lost buffer.

The usual multi-CDN "failover" is a catch block that rewrites segment URLs from CDN A to CDN B and reloads the stream. It loses the buffer, resets the ABR decision, and shows a spinner. Content steering moves the routing decision into the manifest layer, where the player already lives. It's standardized in HLS and DASH, and hls.js supports it. Let's build it.

1. Tag your playlist with pathways

A pathway is a named route to your content, usually one per CDN. In the multivariant (master) playlist you point the player at a steering server and give every variant a PATHWAY-ID.