Skip to content
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

Improve MediaController #479

Closed
1 task
StaehliJ opened this issue Mar 25, 2024 · 0 comments · Fixed by #485
Closed
1 task

Improve MediaController #479

StaehliJ opened this issue Mar 25, 2024 · 0 comments · Fixed by #485
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@StaehliJ
Copy link
Contributor

StaehliJ commented Mar 25, 2024

As a user / integrator I can easily get a MediaController or MediaBrowser instance.

Context

Creating a MediaController or a MediaBrowser can be a pain in the neck. The usage of ListenableFuture and knowing how to do it is a bit hard. Another problem is the custom function and listener added by Pillarbox than can be called from theses instances.

### Actual code to be done

val builder : MediaController.Builder = ...
val future: ListenableFuture<MediaController> = builder.buildAsync()
future.addListener(() -> {
    try {
        val controller:MediaController = future.get()
        // The session accepted the connection.
        } catch (e:ExecutionException) {
             if (e.getCause() is SecurityException) {
             // The session rejected the connection.
             }
        }
     }, ContextCompat.getMainExecutor())
}

Proposition

Integrators can fetch a custom MediaController with a suspend function.

scope.launch() {
    val controller  =  PillarboxMediaController.Builder(...).buildAsnc()
    doSomethingWithController(controller)
}

Acceptance criteria

  • MediaController instance can be created with one suspend function
  • MediaBrowser instance can be created with one suspend function.

Tasks

  • ...
@StaehliJ StaehliJ self-assigned this Mar 25, 2024
@MGaetan89 MGaetan89 added this to the 2.0.0 milestone Mar 26, 2024
@MGaetan89 MGaetan89 added the enhancement New feature or request label Mar 26, 2024
@MGaetan89 MGaetan89 linked a pull request Apr 5, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants