media icon indicating copy to clipboard operation
media copied to clipboard

Add Kotlin-friendly APIs

Open JolandaVerhoef opened this issue 1 year ago • 4 comments

The Media3 library is written in Java and thus has APIs that are easy to consume from Java code, but harder to work with in a Kotlin codebase. Developers using Kotlin should be able to use Kotlin concepts such as coroutines and Flows when interacting with the library.

JolandaVerhoef avatar Aug 22 '23 07:08 JolandaVerhoef

Is this open for external contributions?

Kshitij09-sc avatar Aug 22 '23 08:08 Kshitij09-sc

Subbed

sonrohan avatar May 06 '24 23:05 sonrohan

🦗

joshuamking avatar Aug 08 '24 12:08 joshuamking

FYI - we've recently merged the first Kotlin API in the common library:

  • https://github.com/androidx/media/commit/018d0488e1a939fc9bb1c9a323adb06ba619fdc6 creates the artifact.
  • https://github.com/androidx/media/commit/61e68d3f24a040407c2d78d3be210bb1fa8680e9 created the suspend fun wrapper for the Player.onEvents callback.
  • https://github.com/androidx/media/commit/9ace81bf2f5940bcb2585d19b12c12f36468125d moves the code into the artifact.

Please try it out by running the latest main on your machine. We're happy to hear feedback.

JolandaVerhoef avatar Aug 08 '24 12:08 JolandaVerhoef