Player.Source Unresponsive - API 35 (OK on 26)

@Anke, thanks for your attention to this post!

Do I understand that you imported the test case UIPlayer_badURL.aia, selected the URL ("https://streaming.live365.com/a28600") from the selection list using btn "Select URL" and then tapped the btn "Play" and the WKUL radio station was not played?

Hmmm...this URL works for me on API 26 as well as API 35...

Let me more briefly state my question/problem:

An app consisting of a single Player component and the following block works on Android 8 (API 26) (plays KDFC) but does NOT work on Android 15 (API 35), nor does it execute the Screen1.Error_Occurred, Player.PlayerError or raise a runtime error.... it becomes unresponsive.

If possible I would like to know why and whether or not I can fix/work around it. If not, how can the condition/error be "trapped" to avoid setting the source to a URL that will make the app unresponsive.

I hope that is clearer than my original post.

Any ideas? Perhaps the logcat output for this simplified case will reveal the problem...

Help?

-Randal

See here how to use logcat

Also what is the complete url you are using? And to make it as simple as possible for others, what about providing a simple example project?

Taifun

Thanks for the comments and suggestions!

I have been using "adb.exe logcat", but I need to take a look at the tutorial you mentioned above.

Opps! It is truncated in the text block above :frowning: The KDFC URL that is causing me problems is: "https://18243.live.streamtheworld.com:443/KDFCFMAAC96_SC"

Here is a single component, single block project that illustrates the issue. It works on API 26 and becomes unresponsive on API 35:
PlayAudioStream.aia (1.6 KB)

It contains a Player component and the single block shown above.

I have not yet looked at the logcat output.....

-Randal

This is an AAC stream (more precisely: AAC+ or HE-AAC at 96 kbps), as delivered by StreamTheWorld (a popular provider for radio stations like KDFC FM). AAC is a more efficient compression format than MP3, but it has known compatibility issues in App Inventor:

The Player component generally supports AAC, but not always AAC+ (enhanced AAC), especially for high-bitrate streams or specific encodings. It still works on older Android versions (< API 29) because the MediaPlayer implementation is more tolerant.

ExoPlayer (in Kodular) works seamlessly with all streaming formats.


My URL is a standard MP3 stream. MP3 has been fully supported by Android's MediaPlayer since version 4.4 (KitKat). There are no buffering issues, and compatibility is independent of the Android version. Therefore, it runs flawlessly on all Android versions (Android > 4.3).

I remember @Patryk_F sending me a test app (with an AudioExoPlayer extension) to test a while back.

It is here:

1 Like

@Anke, THANK-YOU for the explanation(s) ...

... this really helps me understand what to expect...as it turns out, I do not really need this particular station (KDFC) to work in my app (which focuses on live sports events). But as I select and add stations to my app I should watch for these extended AAC formats... if I continue to use the standard Player component.

How can I tell whether or not the AAC stream is AAC+ or HE-AAC?

Frequently I have choices as to which URL in a .pls file to use or even which station to select for my app, but I do not know how to tell what the precise format is.

I have yet to import/use a Kodular extension in AppInventor. Is this the extension to which you refer:
"V1.0.5 Exoplayer for AppInventor | Play media with Google's Exoplayer - Extensions - Kodular Community"?

What about the Audio Player extension by @Taifun? Do you think it would also have problems with some ACC streams?

Can you tell me more about this one: (AudioExoPlayer)? Is it available?

I am also concerned about recovery at runtime from making the error of attempting to set the source to an incompatible format.... Perhaps one of these implementations will do a better job of trapping the error so that the app does not become unresponsive.

I appreciate your discussing this with me.

Kind regards,
Randal

My extension App Inventor Extensions: Audio Player | Pura Vida Apps wlill have the same as the player component, because

The extension is a copy of the MIT Player component and fixes a Loop issue, which occurs for Android versions API 22 and newer

Taifun

1 Like

It looks like you have overseen this

Taifun

I suppose I should have just looked at this myself :frowning: - thanks for clarifying it for me.

Thanks for the link!

Finally, what about the Kodular Exoplayer? Is this it: "V1.0.5 Exoplayer for AppInventor | Play media with Google's Exoplayer - Extensions - Kodular Community" ? I found it linked on your extensions page.

I have downloaded and built the exoplayer_v1.0.5.aia ... and replaced the url with the KDFC that was causing my Player problems... and it works!

But I am having trouble correlating the coded blocks in the exoplayer_v1.0.5 app and with the documentation I found here : "ExoPlayer - Kodular Docs".

Am I missing a layer (is the Kodular ExoPlayer an implementation of the Core/Ui .aix components that I have not yet found?

Just how confused am I :slight_smile:

Thanks for your continued help,
-Randal

It's an outdated version of ExoPlayer, which, according to the Kodular team, should have been updated 6 years ago. See here:

However, as always, this hasn't happened. Nevertheless, ExoPlayer still works, and AAC+ streaming formats play flawlessly.


What's the problem with @Patryk_F 's great AudioExoPlayer extension?

@Anke, thanks again for continuing the discussion!

Nothing as far as I know - I like the K-ExoPlayer's selection of events (according to the docs here: "ExoPlayer - Kodular Docs") - includes OtherPlayer... events.

I gather you would recommend AudioExoPlayer over the Kodular ExoPlayer (1.0.5), correct? care to comment on specific issues with K-ExoPlayer for audio streams (other than what is written in the post above from Feb 2020)? I certainly like the fact that @Patryk_F's AudioExoPlayer seems to be currently under development/maintenance.

Thanks and kind regards,
-Randal

You're talking about two different components. Kodular has a built-in ExoPlayer component; you're showing its documentation. However, to use it, you need to build your app in Kodular, not AppInventor. In that case, you'll need to seek help from the Kodular community. @Anke is talking about the ExoPlayer extension. The documentation for the extension is included in the Kodular community thread where you downloaded the extension. This extension will never be updated, and if something stops working, you'll have to rebuild the app again. My extension is built on a newer version of the ExoPlayer library, which is included in Media3. If you're missing a function or block, I can add it.

1 Like

Hi @Patryk_f,

Thank you very much for explaining this.

Very kind offer. I will keep this in mind :slight_smile: :slight_smile:

BTW, is there a way for me to be auto-notified when you or others post in this forum regarding AudioExoPlayer extension?

Thanks again,
Randal

image

Select "Watching" in the topic you want new replies notified

Thanks, @TIMAI2!

-Randal

While the KDFC url works nicely, I am having trouble with another url: "https://streaming.live365.com/a28600"

When I set the AddMedia path to it, I get an error in the exoplayer_v1.0.5 app:

But this URL works from a web browser as well as other apps that use AI2 Player component...???

-Randal

This page does not work in my browser.

Hmmm....
When I paste "https://streaming.live365.com/a28600" (without the quotes)
into Chrome on my phone (and Windows PC) it plays the WKUL station stream...

In what regard does it "not work" in my browser???

Very confused :slight_smile:
-Randal

This link doesn't work for me in chrome, both on my phone and PC.

It was supposed to be "in my browser." I don't know why I wrote "your"