androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
Apache License 2.0
1.36k stars 322 forks source link

Media3 MediaSession custom error messages #543

Open abouda opened 11 months ago

abouda commented 11 months ago

Is there an equivalent in media3 for these?

marcbaechinger commented 11 months ago

There is no such functionality in Media3.

Who would be the consumer of the error messages?

abouda commented 11 months ago
abouda commented 11 months ago

Also another point is although I could handle the error onPlayerError(PlaybackException) in my app, it does not solve it for legacy controllers like AndroidAuto.

marcbaechinger commented 11 months ago

Yes, this is a regression compared with what's possible with the legacy API. We need to look into this. Marked as enhancement.

Bwaim commented 4 months ago

@marcbaechinger do you hav any news on this ?

marcbaechinger commented 4 months ago

Yeah, sorry no news yet.

I don't think this will be part of 1.3 I'm afraid. We will update this issue as soon as we pushed a change that adds this.

Flyktsodan commented 3 months ago

Our app update got rejected in playstore review because we didn't send error messages when using android auto. In other words this should be a blocker for many media app(s).

benjaminVadon commented 3 months ago

@marcbaechinger have you any update about this limitation ? Is it planned for the next version ?

marcbaechinger commented 2 months ago

This is planned for 1.4 which is the next release.

marcbaechinger commented 1 month ago

The commit above added an API to send non-fatal errors to a MediaController.

When sent to all controllers or specifically to the media notification controller (MediaSession.getMediaNotificationControllerInfo()), the error code, message and extras are included in the PlaybackStateCompat with state=STATE_ERROR (7) and sent to the platform/legacy session from where a platform or legacy controller (for instance Android Auto) can read it.

icutvaric commented 3 weeks ago

Hello!

Any updates on this?

Or any suggestion how to do authentication on Automotive OS with Media3: https://developer.android.com/training/cars/media/automotive-os#require-sign-in?

Thanks!

kelmer44 commented 3 weeks ago

Is there a reason why a resource Id is necessary? Could the method not accept just a plain string as well?

marcbaechinger commented 3 weeks ago

This API has changed. The change that includes this is on its way into the main branch.

There will be a SessionError instead of the three parameters: MediaSession.sendError(ControllerInfo, SessionError). The message argument of the constructor of MediaSession is a String instead of a resource ID. Please use a localized string either way for the benefit of your users.

kelmer44 commented 3 weeks ago

@marcbaechinger thats great! I do plan on using a localized string, only we dont use the android resources in our project, but an alternative solution

chillbrodev commented 2 weeks ago

This is planned for 1.4 which is the next release.

Is there a potential release date for 1.4?

marcbaechinger commented 2 weeks ago

We are currently preparing the beta01. The stable release of 1.4.0 is expected to be in mid July.