Pillarbox is the modern SRG SSR multimedia player ecosystem, built on top of AndroidX Media3. Pillarbox has been designed with robustness, flexibility, and efficiency in mind, with full customization of:
- Metadata and asset URL retrieval.
- Asset resource loading, including support for Widevine and PlayReady.
- Analytics integration.
- User interface layout, in either Compose or XML
View
s. Helpers are available in thepillarbox-ui
module.
Its robust player provides all essential playback features you might expect:
- Audio and video (including 360° videos) playback.
- Support for on-demand and live streams, with and without DVR.
- Integration with the system playback user experience.
- Integration with Android's
MediaSession
and Android Auto. - Playlist management (navigation to previous/next item, shuffle, repeat, ...).
- Support for alternative audio tracks, audio description, subtitles, ...
- Multiple instances support.
- Picture-in-picture support.
- Playback speed controls.
In addition, Pillarbox provides support for SRG SSR content by including the pillarbox-core-business
module (see "Getting started" below).
Tip
Pillarbox is also available on Apple platforms and the Web.
You can easily get your hands on Pillarbox by running one of the demo applications available in this project: pillarbox-demo for phone/tablet, or pillarbox-demo-tv for TV.
Each application allows you to:
- Try Pillarbox with various media types and sources.
- See how Pillarbox answers various use cases (
pillarbox-demo
only). - Access a wide range of SRG SSR content.
- Search for specific SRG SSR content.
Pillarbox is deployed to GitHub Packages. So you need to add the following repository in your Gradle configuration:
// If you declare your repositories in the `settings.gradle(.kts)` file
repositories {
maven("https://maven.pkg.github.com/SRGSSR/pillarbox-android") {
credentials {
username = providers.gradleProperty("gpr.user").get()
password = providers.gradleProperty("gpr.key").get()
}
}
}
// If you declare your repositories in the root `build.gradle(.kts)` file
repositories {
maven("https://maven.pkg.github.com/SRGSSR/pillarbox-android") {
credentials {
username = project.findProperty("gpr.user")?.toString()
password = project.findProperty("gpr.key")?.toString()
}
}
}
- Go to Settings > Developer Settings > Personal access tokens.
- Click on
Generate new token
. - Provide a note for the token, and change the expiration (if needed).
- Make sure that at least the
read:packages
scope is selected. - Click on
Generate token
. - Copy your Personal access token.
- In your
~/.gradle/gradle.properties
file (create it if needed), add the following properties:
gpr.user=<your_GitHub_username>
gpr.key=<your_GitHub_personal_access_token>
Tip
You can check the GitHub documentation for more information.
In your module's build.gradle
/build.gradle.kts
file, add the following dependencies, based on your needs:
// Player specific features
implementation("ch.srgssr.pillarbox:pillarbox-player:<pillarbox_version>")
// Library to handle Cast integration
implementation("ch.srgssr.pillarbox:pillarbox-cast:<pillarbox_version>")
// Library to handle SRG SSR content through media URNs
implementation("ch.srgssr.pillarbox:pillarbox-core-business:<pillarbox_version>")
// Library to display the video surface
implementation("ch.srgssr.pillarbox:pillarbox-ui:<pillarbox_version>")
If not already enabled, you also need to turn on Java 17 support in every build.gradle
/build.gradle.kts
files using Pillarbox. To do so, add/update the following to/in the android
section:
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
To start using Pillarbox in your project, you can check each module's documentation:
If you want to contribute to the project have a look at our contributing guide.
See the LICENSE file for more information.