Skip to content

SRGSSR/androidx-mediarouter-compose

Repository files navigation

androidx-mediarouter-compose

Last release Android min SDK Build status License

Simplify media routing in your Compose app with this native Material 3 MediaRouter library. Enjoy easy integration, a pure Compose-friendly approach, and no need for AppCompatActivity or Theme.AppCompat.*. Focus on what matters: creating seamless media experiences for your users.

Warning

This library is under active development. While some features may be missing or unstable, your feedback is valuable. Please report any problems you encounter or feature requests you have by opening an issue.

Getting started

This library is available as a GitHub Package. Follow GitHub's documentation to set up the repository in your project.

Setting up the repository

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/SRGSSR/androidx-mediarouter-compose")
        credentials {
            username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
            password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
        }
    }
}

Declaring the dependency

In your module build.gradle(.kts) file, add the following:

dependencies {
    implementation("ch.srgssr.androidx.mediarouter:mediarouter-compose:<version>")
}

Display a MediaRouteButton

To enable users to connect to remote devices and control media playback, add the MediaRouteButton to your screen:

MediaRouteButton()

By default, no routes are displayed because it uses an empty MediaRouteSelector. Configure this by providing your own MediaRouteSelector:

MediaRouteButton(
    routeSelector = MediaRouteSelector.Builder()
        .addControlCategory(MediaControlIntent.CATEGORY_LIVE_VIDEO)
        .addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)
        .build(),
)

Release

This library is automatically published and released to GitHub Packages whenever a new tag following the x.y.z pattern is pushed.

License

See the license file for more information.

About

Seamless integration of AndroidX MediaRouter with Compose

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Languages