Skip to content

feat: Track disableRemotePlayback Preference - #1889

Open
spuppo-mux wants to merge 4 commits into
videojs:mainfrom
spuppo-mux:feat/remote-playback-preference
Open

feat: Track disableRemotePlayback Preference#1889
spuppo-mux wants to merge 4 commits into
videojs:mainfrom
spuppo-mux:feat/remote-playback-preference

Conversation

@spuppo-mux

@spuppo-mux spuppo-mux commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Closes #1800.

What

When a page author sets disableRemotePlayback, the hls.js AirPlay bridge now respects it instead of unconditionally clearing it.

How

HlsJsMedia snapshots the element's disableRemotePlayback in attach(), before any engine attaches and while the value still reflects author intent, and hands it to the inner HlsJsOnlyMedia delegate (which hosts the AirPlay bridge) in load().

The bridge only clears the flag when the author didn't set it:

if (!this.authorDisableRemotePlayback) {
  target.disableRemotePlayback = false;
}

This works uniformly for both platforms without a shared-plumbing change: in HTML the <hlsjs-video disableRemotePlayback> attribute is mirrored onto the inner <video> at construction; in React disableRemotePlayback is a plain prop React applies to the <video>. Either way the facade reads it before hls.js overwrites it.

Testing

  • airplay-bridge.test.ts: preserves disableRemotePlayback when the author set it; still enables AirPlay when it was set programmatically (no author intent).
  • Manual: Safari + an AirPlay receiver, picker suppressed with the attribute, offered without it.

Note

Low Risk
Small, WebKit/AirPlay-specific behavior change with unit tests; default AirPlay behavior is unchanged when authors do not set disableRemotePlayback.

Overview
Hls.js MSE playback no longer forces AirPlay on when the page author set disableRemotePlayback on the video.

HlsJsMedia copies the element’s disableRemotePlayback into the MSE delegate as authorDisableRemotePlayback when the engine is created in load() (before attach/hls.js can change the flag). The AirPlay bridge only clears disableRemotePlayback when that snapshot is false, so programmatic/hls.js-only true still gets reset for the AirPlay picker.

Tests cover explicit author opt-out vs programmatic-only disableRemotePlayback.

Reviewed by Cursor Bugbot for commit dff2865. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

@spuppo-mux is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@netlify

netlify Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit dff2865
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/6a6cf539c759a60008cfc963
😎 Deploy Preview https://deploy-preview-1889--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6bb4ed3. Configure here.

Comment thread packages/media/src/dom/hls-js/media.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Track Author Preference for disableRemotePlayback on AirPlay on MSE

1 participant