-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: workaround to make Airplay work on Safari #74
base: master
Are you sure you want to change the base?
Conversation
var source = document.createElement('source'); | ||
source.src = stream.url; | ||
videoElement.appendChild(source); | ||
videoElement.disableRemotePlayback = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be moved on line 28?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this has to be done after calling hls.attachMedia(videoElement);
and media is attaching, hence this is done on the Hls.Events.MEDIA_ATTACHING
event.
I tested this with many other variations and this is the only way that got it working.
function attachOriginalSource() { | ||
var source = document.createElement('source'); | ||
source.src = stream.url; | ||
videoElement.appendChild(source); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to add the corresponding action in the unload
command handler after the videoElement.removeAttribute('src');
call
something like:
while (videoElement.child) videoElement.removeChild(videoElement.child)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Any update on this? |
It's ready to be merged for a long time on my end |
Implemented the suggested workaround from this comment to make Airplay work in Safari.
For some reason, audio doesn't play on Airplay on my TV, but I think this should probably be handled on the streaming server.
Previously, using Airplay didn't work at all, so this PR is still an improvement since the video is now displayed on the target device properly.
Airplay support was added to the player of Stremio Web in this PR: Stremio/stremio-web#629