fix: Properly setup DRM to support Airplay#1245
Merged
spuppo-mux merged 8 commits intomuxinc:mainfrom Dec 3, 2025
Merged
Conversation
|
@spuppo-mux is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
spuppo-mux
commented
Dec 2, 2025
There was a problem hiding this comment.
Pull request overview
This PR fixes DRM support for AirPlay by properly handling multiple license requests from Apple TV. The main issue was that the code only listened once to the 'message' event, but newer Apple TV versions send multiple messages when using AirPlay.
Key Changes:
- Refactored the FairPlay encryption handler into smaller, more maintainable functions
- Changed the 'message' event listener from
{ once: true }to persistent to handle multiple AirPlay license requests - Updated error handling to use
saveAndDispatchErrorconsistently instead ofPromise.reject
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…changed saveAndDispatchError to Promise.reject to propagate failure; added teardown function to remove listeners and close session.
luwes
reviewed
Dec 3, 2025
luwes
reviewed
Dec 3, 2025
| return; | ||
| } | ||
|
|
||
| console.error(errOrResp); |
Merged
luwes
pushed a commit
that referenced
this pull request
Dec 4, 2025
🤖 I have created a release *beep* *boop* --- <details><summary>@mux/mux-audio: 0.15.17</summary> ## [0.15.17](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.15.16...@mux/mux-audio@0.15.17) (2025-12-04) ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/playback-core bumped from 0.31.4 to 0.32.0 </details> <details><summary>@mux/mux-audio-react: 0.15.17</summary> ## [0.15.17](https://github.com/muxinc/elements/compare/@mux/mux-audio-react@0.15.16...@mux/mux-audio-react@0.15.17) (2025-12-04) ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/playback-core bumped from 0.31.4 to 0.32.0 </details> <details><summary>@mux/playback-core: 0.32.0</summary> ## [0.32.0](https://github.com/muxinc/elements/compare/@mux/playback-core@0.31.4...@mux/playback-core@0.32.0) (2025-12-04) ### Features * add `max-auto-resolution` attribute for automatic resolution capping ([#1243](#1243)) ([a43edd5](a43edd5)) ### Bug Fixes * Properly setup DRM to support Airplay ([#1245](#1245)) ([673b7ff](673b7ff)) </details> <details><summary>@mux/mux-player: 3.10.0</summary> ## [3.10.0](https://github.com/muxinc/elements/compare/@mux/mux-player@3.9.2...@mux/mux-player@3.10.0) (2025-12-04) ### Features * add `max-auto-resolution` attribute for automatic resolution capping ([#1243](#1243)) ([a43edd5](a43edd5)) ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/mux-video bumped from 0.28.2 to 0.29.0 * @mux/playback-core bumped from 0.31.4 to 0.32.0 </details> <details><summary>@mux/mux-player-astro: 3.10.0</summary> ## [3.10.0](https://github.com/muxinc/elements/compare/@mux/mux-player-astro@3.9.2...@mux/mux-player-astro@3.10.0) (2025-12-04) ### Miscellaneous Chores * **@mux/mux-player-astro:** Synchronize player versions ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/mux-player bumped from 3.9.2 to 3.10.0 * @mux/playback-core bumped from 0.31.4 to 0.32.0 </details> <details><summary>@mux/mux-player-react: 3.10.0</summary> ## [3.10.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@3.9.2...@mux/mux-player-react@3.10.0) (2025-12-04) ### Features * add `max-auto-resolution` attribute for automatic resolution capping ([#1243](#1243)) ([a43edd5](a43edd5)) ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/mux-player bumped from 3.9.2 to 3.10.0 * @mux/playback-core bumped from 0.31.4 to 0.32.0 </details> <details><summary>@mux/mux-video: 0.29.0</summary> ## [0.29.0](https://github.com/muxinc/elements/compare/@mux/mux-video@0.28.2...@mux/mux-video@0.29.0) (2025-12-04) ### Features * add `max-auto-resolution` attribute for automatic resolution capping ([#1243](#1243)) ([a43edd5](a43edd5)) ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/playback-core bumped from 0.31.4 to 0.32.0 </details> <details><summary>@mux/mux-video-react: 0.29.0</summary> ## [0.29.0](https://github.com/muxinc/elements/compare/@mux/mux-video-react@0.28.2...@mux/mux-video-react@0.29.0) (2025-12-04) ### Miscellaneous Chores * **@mux/mux-video-react:** Synchronize video versions ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/playback-core bumped from 0.31.4 to 0.32.0 </details> <details><summary>@mux/mux-uploader: 1.4.1</summary> ## [1.4.1](https://github.com/muxinc/elements/compare/@mux/mux-uploader@1.4.0...@mux/mux-uploader@1.4.1) (2025-12-04) ### Bug Fixes * button text for file-select slot can now be customized ([#1252](#1252)) ([240d2ae](240d2ae)) </details> <details><summary>@mux/mux-uploader-astro: 1.4.1</summary> ## [1.4.1](https://github.com/muxinc/elements/compare/@mux/mux-uploader-astro@1.4.0...@mux/mux-uploader-astro@1.4.1) (2025-12-04) ### Miscellaneous Chores * **@mux/mux-uploader-astro:** Synchronize uploader versions ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/mux-uploader bumped from 1.4.0 to 1.4.1 </details> <details><summary>@mux/mux-uploader-react: 1.4.1</summary> ## [1.4.1](https://github.com/muxinc/elements/compare/@mux/mux-uploader-react@1.4.0...@mux/mux-uploader-react@1.4.1) (2025-12-04) ### Miscellaneous Chores * **@mux/mux-uploader-react:** Synchronize uploader versions ### Dependencies * The following workspace dependencies were updated * dependencies * @mux/mux-uploader bumped from 1.4.0 to 1.4.1 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #183
I also reorganized the
onFpEncryptedcallback to get a better understanding of the code and compare it with the FairPlay Streaming Overview.The main issue here was that we were ignoring the Apple TV SPC when generating the DRM license. This is reflected on the
session.addEventListener('message', ...)changes. We were listening just once to this message, but more recent versions of Apple TV send new messages when using AirPlay. Therefore I modified that listener to ask for that license again and update the session for each new message.Note for reviewers: Please pay extra attention to the way I reformatted this code (not sure if I should change some Promise.reject), the new error messages and/or if I should be removing the event listener at some point.