Fix: Resolve AirPlay Availability Issues by Enabling Remote Playback #1558
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.
Related:
closes #1522
Description:
In the Hls.js repository, there are lines of code that remove video sources and set
disableRemotePlayback
totrue
.In your
vidstack/player
code, I found only appending sources after attaching an element to the Hls.js instance. However, there's no code to setdisableRemotePlayback
tofalse
after this attachment.Impact:
Not setting
disableRemotePlayback
tofalse
disrupts the logic when watching the availability of AirPlay state. WhendisableRemotePlayback
istrue
,watchAvailability
throws an error indicating an invalid state, and the support flag remainsfalse
. Consequently, the AirPlay button does not appear.Additional Note:
There's another issue with AirPlay functionality: to work correctly on iOS with Hls.js, the video element must have
autoplay
set totrue
. Without it, AirPlay doesn't function as expected. This might be an issue with iOS itself.Ready?
The provided code resolves the issue by allowing the remote playback API to accurately detect AirPlay availability. However, I recommend integrating this fix in a more appropriate location within the codebase to maintain code quality and consistency. Additionally, addressing the autoplay requirement for iOS should be considered, potentially as a separate issue.
Anything Else?
video-dev/hls.js#6482