Protected HLS Stream
VOD content served via Gcore CDN with path-embedded token.
Token mode
How it works — hls.js:
TokenRefreshPlugin injects a custom hls.js loader
that rewrites /{token}/{expires}/ in every segment,
playlist and key URL before the XHR is opened. The refresh timer
fires 10 s before expiry and updates the shared token state — the
loader picks it up on the very next request with zero interruption.
dash.js:
For DASH streams the plugin registers a
requestInterceptor on the dash.js
MediaPlayer instance. The interceptor rewrites the
same /{token}/{expires}/ pattern in every segment and
manifest request, giving seamless token refresh with no buffering
gap. Pass a DASH source with mimeType: "application/dash+xml"
and the plugin selects the DASH path automatically.
Safari (native HLS):
hls.js runs on Safari 14.5+ (MSE support) so the seamless loader
path is used. Older Safari falls back to native
<video> HLS; the plugin then reloads the source
URL and seeks back to the saved position. For fully seamless refresh
on older Safari, register token-refresh-sw.js as a
Service Worker — the SW intercepts all CDN fetch requests and
rewrites the token even for native media elements.