Open AnshumanHexabrain opened 1 month ago
@AnshumanHexabrain
I think there is some confusion in your code logic. It appears that you are creating the controller and then sending it via MessageEvent to your session service code of which you are then setting the controller as the player? The session code should have its own ExoPlayer instance that will be running the media playback. It should not be the controller.
Perhaps it would help to review the developer documentation we have, https://developer.android.com/media/implement/playback-app.
All you should need to do is set the correct token on the building of your MediaController. You shouldn't need to pass the controller to the session code.
Here is some other resources and code that may be helpful.
Hopefully that helps! Please write back if you have additional questions.
Hello there, First off, I want to say a big thank you for the amazing work on Media3! 🎉 The integration process was really smooth, and I'm super impressed.
I have a query regarding crash issue in MediaLibraryService
I have a implemented MediaLibraryService for mobile and android auto and getting an crash while opening the activity like
RuntimeException while executing runnable AudioWithSyncServiceActivity$$ExternalSyntheticLambda0@a30fc82 with executor MoreExecutors.directExecutor() java.util.concurrent.ExecutionException: java.lang.SecurityException: Session rejected the connection request. at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:594) at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:553)
As I have added below code for my activity and service
Activity ` private lateinit var controllerFuture: ListenableFuture
private val controller: MediaController?
get() = if (controllerFuture.isDone && !controllerFuture.isCancelled) controllerFuture.get() else null
onService class