It's not about idleness. We're talking about another bug, when switching streams sometimes some streams stop the player and then no other stream can be played. it's like webview is hanging... Then you have to turn the app off and on again. But later on the same link works that previously failed...
For that matter, I'm already experimenting with the Itoo extension, and your ActivityLifecycle. Is there any extension you recommend for the Foreground service?
I also made an extension that fetches Metadata from the url link, useful when using a WebView instead of a player.
Tried using open another screen screenName Block as you suggested. Unfortunately it does not unlock the Custom Web Viewer. Interesting potential work around but it is not a solution. Thanks
Congratulations.
I've done a radio app before. You can update the radio list via google drive. No problem so far though
The radio was a problem when the phone rang. You had to turn off the radio. That's why I added dialing blocks. If a call comes in, the radio is switched to mute. After the call ends, the radio starts playing again.
I was making it keep playing with the clock block in the background.
Maybe you can add something like this.
I would recommend.
It might be worth a try creating an html file to play back the audio streams, then you could use javascript to detect/handle any errors in the playback stream....
I will clean up this example up and integrate KAS into a version of Radio Stream Player later today or tomorrow (unless someone else post a more detailed example first) that supports doze mode. Be aware, like a Stay Awake routine, KAS eats battery energy.
Tested on an Android 13 Samsung A13. Played the stream continuously for over 45 minutes (when I stopped testing) while allowing a phone call and use of other apps while streaming.
This is how I used phone call blocks in my radio show.
My app used to work better. It even worked on Android 2.4 version.
But it started to cause problems in higher versions. I did not fix the program afterwards. I am doing the update from a file on google drive.
I haven't updated my radio app because of this.
I moved it to the internet.
It can be listened through the internet browser.
www.mikrobotikradyo.tk
You are using the player component. I tested yesterday with the Player, loading the stream to the Player is synchronous and freezes the entire app for a while or longer. Are you experiencing this? This is especially noticeable in the ListView.
I did some tests with custom <audio> and custom <video> in html. Unfortunately, I cannot make the playback start automatically like it does with the original player. I have the autoplay control set.
Doesn't work, Chrome blocked that too. To play sound, user must interact with the web page (touch/click), you cannot program it (e.g. with javascript).
If calling a url directly into the webview, it will play automatically. Any kind of web page that has a sound source will not play unless the user interacts with the webpage to say "yes, I want sound"
This stops all websites from playing sound automatically in their ads etc. You can autoplay a sound file, but it has to be muted, the user then has to unmute the playback by interacting with the web page.
<audio id="radio" autoplay muted>
<source src="http://stream.live.vc.bbcmedia.co.uk/bbc_radio_two">
Your browser does not support the audio element.
</audio>
<button id="unmuteButton">UNMUTE</button>
<script>
var radio = document.getElementById('radio');
unmuteButton.addEventListener('click', function() {
radio.muted = false;
});
</script>
So unmute or play can't be called from outside? So Google thinks for us again and knows better what people want. And it would be enough for them to add some permission so that the user can decide what he wants to play automatically and what not...