-
Notifications
You must be signed in to change notification settings - Fork 2
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
Hop mode doesn't work with an android screenlocked #2
Comments
Thanks for your report! We know that we have some issue with the player minimized or backgrounded... Mute mode works great because sound volume is simply reduced during ads/talks. @dest4 have you made some experiments previously about this subject? |
Thanks for your report. I have received this feedback several times, it should be our priority now. |
By the way we have a similar issue in iOS. |
Not really, let me try to explain it more clearly. The native player UI, that allow you to control the media on the notification screen of your OS, should never close. So when switching radio channels, the webapp need to stitch the 2 audio stream, without closing the notification player. To get something like I took a look at the code in |
So I started the investigations, and it's not very conclusive yet... I created a test page to reproduce this issue, with a similar context that the actual player. It includes MediaElement library and it switch between two radio streams every 5s. That allows me to try different situations, like :
Android 9, Firefox, screen off and locked. About the last, you can read more here : https://stackoverflow.com/questions/5927284/how-can-i-make-setinterval-also-work-when-a-tab-is-inactive-in-chrome All these experiments have the same common issue: it start to fail after ~5min. Playback simply stops. It will behave perfectly fine again after a screen wake up. |
Now this is my current reading : https://www.html5rocks.com/en/tutorials/webaudio/intro/ |
Before all, Web Audio API doesn't support live stream for now. I read somewhere this is a work in progress. For now we have to rely on an HTMLAudioElement ( It looks a little bit wonky to me. But anyway, it works, and it allows us right now to use this powerful new Web Audio API. I developed a small sandbox to experiment crossfading between two sources. You can try it here: https://testaudio.techn4k.now.sh/ Both streams will play across a common AudioContext, so playback never stops when you crossfade or stop one stream. Click the "auto crossfade" button to alternate between each source every 10s. |
40min without any playback issue, sounds promising! |
Before to dive into this deep sea, I would like to be sure this proposal resolves this issue or at least greatly improve it. In addition to the rewrite of the player, I would like to uncouple playback management (mute/switch on ads) from UI animations. This will allow to disable animations when the application is backgrounded. |
I didn't reported my feedback yesterday because it was quite inconclusive. On Bromite (my Android browser) no sound was coming out from the speakers (even when using the play buttons) but the notification player was there. It is probably an issue from the browser. I'll try other devices with other browsers and report again. But it already seems a good start! |
I tried on two other devices with google chrome, no sound was playing but the player notification was visible. |
@bricewge you're right it's not working on Chrome Android... Firefox only. I'm on it. |
Playback is now working on Chrome and Firefox for Android. |
Crossfading is playing pretty well for me since 40min on Chrome Android. I do not have an iOS device to give a try. Someone here own one? |
Great news, congrats for the progress!
|
Thanks for your checklist! I think CORS question is answered by
RadioNova stream was not playing without this preset. I have never heard about HLS streams ... Have to dig into. |
Here is a brief summary for both topics:
|
Hi guys, The previous version of the sandbox, fully using Web Audio API, was not able to play HLS streams... It's not natively supported. 😞 So I built the same sandbox with MediaElement.js, which allows to play HLS easily. You can try it here : https://testaudio-git-mediaelement.techn4k.now.sh/ I have not tried anything with crossfade and screen off for now. But I noticed the same cracking sound issue with volume slide up/down that on ABR (at least on Firefox). Give me your feedback! |
I have a hard time reporting my various tests on the various prototypes because I find it very difficult to reproduce them. So take my reports with a grain of salt. The second prototype version, when playing in background, with cross-fading stopped playing after 5min. The latest prototype, with no cross-fading and no background, plays the channel1 (HLS) nicely whereas channel2 stops intermittently. Cross-fading on Linux Chromium make it trip on a promise rejection. |
It seems HLS errors are not handled, so that as soon as a HLS error throws, HLS playback stops. Also I think we should not hardcode delays to wait for playback start (2000 ms) but instead use the mediaelement events. I have forked @TeChn4K and am working to further improve it. Will report back when ready |
Here is my work: It works for a while on my screenlocked android (like for 10 minutes with a switch every 3 seconds). Then it stops, probably because I coded it to stop when a stream raises an error. Handling is still partial. On the good side:
|
The last prototype lasted 30min easily on the devices I tired it on. The only minor issue (also present in the previous ones) is the pause button from the notification which isn't effective; after 3sec it start playing the other stream. So there is now way to pause the audio directly from the lock-screen. Anyway, it's looking good, thanks for your work! I hope it'll make it in the webapp soon. |
Same for me, playing last proto for hours without major issue. Time to time some minor switch latencies with screen off. @bricewge We will keep in mind lock screen play/pause button. This is a nice feature! @dest4 I was thinking about to straightly use So, as the last proto is working good for everyone, I will continue on this track. |
I started to develop the standalone player. Right now:
Roadmap:
You can give me feedback if you want but it's not finished yet! Keep your strength up, we will need it ;) |
New features for now:
Missing:
|
Great! :) I have left technical comments in your commits.
|
Understood @dest4, I took some notes for the rest. About the demo/sandbox, this is not the behavior that will be in the "next ABR". Its purpose is to test and approve the stream player as a service, not the UI itself ;) Yes, background playback must be able to play & switch without any timers, and be as lightest as possible. So no smooth transition if we don't want to be "degraded" by browsers. As it stands for now in the production version, this is not possible at all because React/Player/Settings are intertwines and switch between streams involve too many treatments. Unfortunately we need to fully rewrite these core features... |
When listening on an android phone with the screen locked the hope modes (return or stay) doesn't work. Up until an add appear on the radio channel for the first time it works fine, but it fail to switch to the next channel when the add is detected or recover from it.
My guess is that the player stop outputting sound from the webpage when switching channel and that android don't allow a webpage to start playing a sound when the device's screen is off.
Keeping the player up in-between switching channels would probably solve the issue.
Thanks a lot for adblockradio, I had been waiting for something like it forever! I'm eager to see it in an dedicated device/radio.
The text was updated successfully, but these errors were encountered: