Player - Device Audio, Loop - Play Streaming

:upside_down_face:

:question:

I just implemented a floating notification to the Player, where you can Pause, Resume or Stop, I'll be testing it to see if it works well, it could probably be useful for you, the notification is present on any screen you go to, as long as you don't close the application.

Just wait a bit until tomorrow when I get back to the computer.

This image is on Android 11.
On Android 14 it looks even better.

I have not updated the extension in the topic, until tomorrow if all goes well.

Thank you very much Joe but I just need to stop the player whatever the screen it has been started even if it is closed with my Stop button on the player screen.

You are trying to stretch the rules and even limitations of android a bit. The screen is an android activity, you can't access a player instance created in one activity from another activity. To achieve this, the player would have to be created in a separate static class or service. Then you can access such a player from any activity.

If you want to easily achieve what you need with a regular player, you need to use virtual screens.

You can also pause playback on the track selection screen while switching screens, then pass the track title and current time of the currently playing track to the next screen to play that title from that point on the new screen. But you may hear a pause while switching.

Yes, it would be nice !

Where exactly is the problem for you to use virtual screens?

See also tip 1 here

Taifun

I didn't know this limitation... Rebuild the app with virtual screen is a so huge work...

The screenshot is blurry, but what I can see is, that there is much repetition...

Follow the DRY principle - Don't repeat yourself...
Btw. You can copy the blocks from one screen to another... just use the backpack...

Taifun

This is done by the MediaSessionPlayer extension.

Can I use it with Joe's extension ?

I think I have no other choice than using virtual screen only for this player... :sob:

You will hear a pause while buffering (again).

I've started to switch to virtual screen... We can copy and paste blocks but not the design...

Dear Joe, sorry to have bored you with my request because of missing the android rules of screen management.

I just will need help to use itoo extension so the player don't stop when IDLE mode.

I think I can make an extension that allows you to control the player on any screen. I'll check out that challenge soon.

I would really appreciate Patryk because I started to use virtual screen and the App Inventor crashed and asked me to send report... and I loose all my work. So I have to restart from the 3 screens version of my application.

Example of how it works:

TestMultiScreenPlayer.aia (26.8 KB)

1 Like

@David_76 You should try the extension that Patryk shares, it works for me, try it and tell us if it worked for you.


Remember to download your AIA project to your computer every time you make a change so you don't lose your work.


Here is an example with Itoo:

Thank you all very much. I've started to rewrite the code with virtual screen now. I think the code will be more optimized in this way. I would prefer knowing these limitations before. I should have read more tutorials before.

Once again forgive me Joe for having asked you to work on your extension because I thought it was an issue. Now I know it is the way Android work.

And thanks again for the example with itoo. All your help was precious for me.

1 Like

Interesting, if you close all screens when switching, the sound can only be stopped and restarted on Screen2.