Skip to content

feat: add SGAI support on HLS live stream - #126

Merged
birme merged 5 commits into
masterfrom
feat/hls-interstitials
Jan 15, 2026
Merged

birme merged 5 commits into
masterfrom
feat/hls-interstitials

Conversation

@JinHedman

Copy link
Copy Markdown
Contributor

Add SGAI support on HLS live stream with tracking support.
Updated the hls.js library and added tracking, the tracking looks for tracking urls in the ad manifest and does a post request when the playtime of an ad reaches a given point, specified in the tracking assets in the ad manifest.

@JinHedman
JinHedman requested a review from birme January 15, 2026 13:25
@JinHedman JinHedman self-assigned this Jan 15, 2026
@JinHedman JinHedman added the enhancement New feature or request label Jan 15, 2026

@birme birme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but fix the failing tests

@JinHedman

Copy link
Copy Markdown
Contributor Author

I'm a bit unsure why the tests fail now, seems to be a problem with a expected attribute on the web-component video player but I haven't changed it

@birme
birme merged commit 708047f into master Jan 15, 2026
2 checks passed
birme pushed a commit that referenced this pull request Mar 13, 2026
On Safari, the web player defaults to native HLS playback (BaseTech),
bypassing hls.js entirely. Since HLS interstitials are not supported
natively in any browser, the SGAI interstitial feature (PR #126) only
worked on Chrome/Firefox where hls.js is always used.

This adds an `enableSgai` option that forces hls.js with
`preferManagedMediaSource: true` even on Safari, enabling HLS
interstitial playback on all browsers.

Changes:
- Add `enableSgai` option to IWebPlayerOptions (core)
- When enabled, bypass Safari native fallback and use HlsJsTech
- Add `preferManagedMediaSource: true` to HlsJsTech default config
- Add SGAI checkbox to demo UI (auto-checked for SGAI streams)
- Recreate player when SGAI toggle changes (tech switch requires it)
- Fix tracking bug: `return` → `continue` in fireTrackingUrls

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@LucasMaupin
LucasMaupin deleted the feat/hls-interstitials branch March 18, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants