Skip to content
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

Allow music to be played in background for Safari on iOS #1279

Open
maaaaz opened this issue Oct 8, 2024 · 6 comments
Open

Allow music to be played in background for Safari on iOS #1279

maaaaz opened this issue Oct 8, 2024 · 6 comments

Comments

@maaaaz
Copy link

maaaaz commented Oct 8, 2024

Hello and thank you for this amazing project !

To date, when playing audio from Safari on iOS, webamp music can't be played in the background. Not even with this "manually playing with the control center" trick.

I am not talking about autoplay, but only playing in the background after pressing the "play" button.

A lot of web-based players can play in the background, for instance the native player on archive.org.
I am clueless about HTML/JS but it seems that Safari on iOS needs a proper <audio> tag in the HTML of the web page.

Can you adapt webamp to allow playing in background ?

Cheers!

@captbaritone
Copy link
Owner

I'm happy to look into this if someone can identify exactly what it is within Webamp that's causing it to not be playable in the background, or if someone is able to find some documentation about under which conditions iOS lets a webpage play audio in the background.

@bitviper8299
Copy link

i think i found out what it is. so iPhone doesnt like javascript. you can enable it to run on mobile iOS, but the problem is is that it doesnt like javascript running in the background, ie when you swipe out. i ben trying to figure out ways into tricking it by messing w audio tags, basically trying to make it seem like its html audio coming from the site rather than java. am i making sense?

@captbaritone
Copy link
Owner

Sadly I don't think that will work. Webamp must attach JavaScript listeners to the audio output in order to do balance, eq, visualizers. Probably not very practical to disable all that stuff.

@bitviper8299
Copy link

yea i assumed so, ive been trying to find ways to trick the browser into thinking html audio is playing, im going to try having an html file with silence just loop in the background when the site is opened, and maybe that can trick it?

@maaaaz
Copy link
Author

maaaaz commented Oct 9, 2024

Thank you all for quickly looking at this issue.

Sadly I don't think that will work. Webamp must attach JavaScript listeners to the audio output in order to do balance, eq, visualizers. Probably not very practical to disable all that stuff.

If we could have, from a user point of view, a webamp "simple" mode where these advanced features of equalizer etc. can be turned off (thanks to a button/switch or whatever), in favor of being able to play in the background, it could be great !

Again, I am totally clueless in HTML/JS and iOS stuff, but I found these:

And again, the native media player from archive.org works correctly with Safari on iOS for background music: https://github.com/internetarchive/iaux-music-player

@maaaaz
Copy link
Author

maaaaz commented Nov 13, 2024

Any chance to have some fix ?

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

No branches or pull requests

3 participants