-
Notifications
You must be signed in to change notification settings - Fork 473
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
Media3 MediaSession custom error messages #543
Comments
There is no such functionality in Media3. Who would be the consumer of the error messages? |
|
Also another point is although I could handle the error |
Yes, this is a regression compared with what's possible with the legacy API. |
@marcbaechinger do you hav any news on this ? |
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. |
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). |
@marcbaechinger have you any update about this limitation ? Is it planned for the next version ? |
This is planned for 1.4 which is the next release. |
This allows to set custom error message for instance on Android Auto/Automotive OS. Issue: #543 PiperOrigin-RevId: 633610089
The commit above added an API to send non-fatal errors to a When sent to all controllers or specifically to the media notification controller ( |
This change resets the error in the platform error state immediately to make sure that the custom error is reflected only very briefly and then gets back to the playback state that actually reflects the player state. Issue: #543 PiperOrigin-RevId: 633626180
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! |
Is there a reason why a resource Id is necessary? Could the method not accept just a plain string as well? |
This API has changed. The change that includes this is on its way into the main branch. There will be a |
@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 |
Is there a potential release date for 1.4? |
We are currently preparing the beta01. The stable release of 1.4.0 is expected to be in mid July. |
Thanks for reporting. What did you do this in the old world to make 'close the "player view" in android auto'? Not sure if this is what you are asking about, but I mean to remember that you can send a This is documented here: https://developers.google.com/cars/design/create-apps/media-apps/signin-flow If this is the case, then you can add the same extras key/value to the
|
@marcbaechinger can you think of any way in how to replicate the old behaviour described above? |
I think Media3 is currently missing an API to send a custom fatal exception in an easy way. The current version allows to send non-fatal errors as you do and it allows to customize error code and error message of a https://developer.android.com/media/media3/session/control-playback#error-handling Sorry for not having a better answer than that we should prioritize this to provide this with the next release. |
Hi @Flyktsodan , I’m facing a similar issue as mentioned in your post and would greatly appreciate your help with the following:
Thanks in advance! |
@marcbaechinger considering that 1.5.0 is almost out, and there are no mentions of the requested feature, could you please let us know if and when there is going to be a way of managing non-player-originated fatal errors? This currently is a huge risk in terms of passing the Google Play review for us, thus stalling the migration to media3
|
https://developer.android.com/media/media3/session/control-playback#fatal-errors doesn't work in this case? |
they do, although this is a really cumbersome way and I think a simpler alternative would be much appreciated. however, this is not applicable to the 1st use-case with the |
Ok thanks. Do I understand correctly that Auto is requesting you to play a song that the user isn't allow to play? So it was presented in the UI, then the user logged out or similar and then the user presses to play that item? |
Yes, you are correct. One of the possible follow-ups: why don't I just refresh the content tree to show no items for the logged out user? This is simply not an option because of our UI/UX requirements, and would be a regression from the legacy media session where we had such kind of control (by the means mentioned by some of the authors above) |
Ah, ok. I would indeed have suggested to trigger a But if this isn't an option for UX reasons we need to seek for other ways. I think a non-fatal is probably not working and I also don't know the impact of that regarding UX:
Sorry, for asking questions for my education: What was the impact on the UI with the legacy library? You kept the listing, then the user clicked and you created an error with What was AAOS then displaying, or more generally what are the UX guidelines in this case? |
no problems with asking questions, I'm glad to help :) first of all, the impact of the non-fatal you are describing above with the
this will result in a stuck "Getting your selection" screen (unless you tap the back button), and an error toast shown at the bottom for a couple of seconds: ![]() this approach has a serious flaw when used from
yes, that's correct. here's a flashback to our previous media2 implementation. things were simpler since we could hack into
this would result in opening a fullscreen AA player with the error state that would persist until the user took some action (e.g. navigating back and playing smth else) ![]() this behavior based on the following guidelines: https://developer.android.com/training/cars/media#errors please let me know if you need any additional input from me |
@marcbaechinger kind reminder in case this got lost |
Thanks I have nothing to add I'm afraid. When you return a |
@marcbaechinger I'd be happy to return would you like me to file a separate issue for you to take a look once you have capacity? in the meantime, here are my workarounds to make this work leveraging the current APIs:
and here's how it would look like after tapping on the media item that is not allowed to play in Android Auto: ![]() ![]() |
Yeah, I meant returning that from I think the remaining piece of this issue is adding ways for apps to generate their own custom So I think regarding the custom I'll do my best to deliver this asap. |
Hi - I'm a PM on the Atlas team checking in on status of this fix? We're building a new instance of Android Auto and need to implement different error messages for different scenarios: https://www.figma.com/design/aFsWpw4nybSQQzUqA4C5fz/CarPlay-%26-Android-Auto%3A-Eng-Spec?node-id=10575-22035&t=kH0E3tldfKnDaKxU-4 I was told this is not currently possible on Android Auto. What's timeline look like for fixing? |
Is there an equivalent in media3 for these?
MediaSessionConnector.setCustomErrorMessage()
to send a custom error message regardless of player state.MediaSessionConnector.setErrorMessageProvider(PlayerErrorMessageProvider)
to convert PlaybackException to a custom error message for connected controllers.The text was updated successfully, but these errors were encountered: