https://github.com/srgssr/pillarbox-android
The modern SRG SSR Pillarbox player targeting Android platforms
https://github.com/srgssr/pillarbox-android
android-library
Last synced: 3 months ago
JSON representation
The modern SRG SSR Pillarbox player targeting Android platforms
- Host: GitHub
- URL: https://github.com/srgssr/pillarbox-android
- Owner: SRGSSR
- License: mit
- Created: 2022-07-29T09:32:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T09:44:13.000Z (about 1 year ago)
- Last Synced: 2024-10-29T09:50:34.206Z (about 1 year ago)
- Topics: android-library
- Language: Kotlin
- Homepage:
- Size: 3.52 MB
- Stars: 13
- Watchers: 12
- Forks: 1
- Open Issues: 19
-
Metadata Files:
- Readme: docs/README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://github.com/SRGSSR/pillarbox-android)
# Overview
[](https://github.com/SRGSSR/pillarbox-android/releases)
[](https://github.com/SRGSSR/pillarbox-android)
[](https://github.com/SRGSSR/pillarbox-android/actions/workflows/quality.yml)
[](https://github.com/SRGSSR/pillarbox-android/blob/main/LICENSE)
Pillarbox is the modern SRG SSR multimedia player ecosystem, built on top of [AndroidX Media3](https://developer.android.com/media/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](https://developer.android.com/develop/ui/compose/layouts) or [XML `View`s](https://developer.android.com/develop/ui/views/layout/declaring-layout). Helpers are available in the `pillarbox-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](https://github.com/SRGSSR/pillarbox-apple/) and the [Web](https://github.com/SRGSSR/pillarbox-web/).
## Demo
You can easily get your hands on Pillarbox by running one of the demo applications available in this project: [pillarbox-demo](../pillarbox-demo) for phone/tablet, or [pillarbox-demo-tv](../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.
## Getting started
### Add the GitHub Packages repository
Pillarbox is deployed to [GitHub Packages](https://github.com/orgs/SRGSSR/packages?repo_name=pillarbox-android). So you need to add the following repository in your Gradle configuration:
```kotlin
// 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()
}
}
}
```
#### Create a Personal access token
1. Go to [Settings > Developer Settings > Personal access tokens](https://github.com/settings/tokens).
2. Click on `Generate new token (classic)`.
3. Provide a note for the token, and change the expiration (if needed).
4. Make sure that at least the `read:packages` scope is selected.
5. Click on `Generate token`.
6. if you are in SRG SSR, click on `Configure SSO`, then `Authorize` the token.
7. Copy your Personal access token.
8. In your `~/.gradle/gradle.properties` file (create it if needed), add the following properties:
```properties
gpr.user=
gpr.key=
```
> [!TIP]
> You can check the [GitHub documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package) for more information.
### Add the SRG SSR Maven repository
Pillarbox is also deployed to the [SRG SSR Maven repository](https://nxrm.rts.ch/repository/maven-srgssr/). If you don't want to use the GitHub Packages repository, add the following to your Gradle configuration:
> [!NOTE]
> You only need to add either the GitHub Packages repository or the SRG SSR repository, not both.
```kotlin
// If you declare your repositories in the `settings.gradle(.kts)` file
repositories {
maven("https://nxrm.rts.ch/repository/maven-srgssr/") {
credentials {
username = providers.gradleProperty("srg_maven_user").get()
password = providers.gradleProperty("srg_maven_password").get()
}
}
}
// If you declare your repositories in the root `build.gradle(.kts)` file
repositories {
maven("https://nxrm.rts.ch/repository/maven-srgssr/") {
credentials {
username = project.findProperty("srg_maven_user")?.toString()
password = project.findProperty("srg_maven_password")?.toString()
}
}
}
```
The necessary credentials can be found in the SRG SSR Bitwarden.
### Add the Pillarbox dependencies
In your module's `build.gradle`/`build.gradle.kts` file, add the following dependencies, based on your needs:
```kotlin
// Player specific features
implementation("ch.srgssr.pillarbox:pillarbox-player:")
// Library to handle Cast integration
implementation("ch.srgssr.pillarbox:pillarbox-cast:")
// Library to handle SRG SSR content through media URNs
implementation("ch.srgssr.pillarbox:pillarbox-core-business:")
// Library to handle SRG SSR Cast receiver with SRG SSR content
implementation("ch.srgssr.pillarbox:pillarbox-core-business-cast:")
// Library to display the video surface
implementation("ch.srgssr.pillarbox:pillarbox-ui:")
```
The latest stable version is [](https://github.com/SRGSSR/pillarbox-android/releases/latest)
### Enable Java 17
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:
```kotlin
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}
```
### Integrate Pillarbox
To start using Pillarbox in your project, you can check each module's documentation:
- [`pillarbox-analytics`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-analytics/docs/README.md)
- [`pillarbox-cast`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-cast/docs/README.md)
- [`pillarbox-core-business`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-core-business/docs/README.md)
- [`pillarbox-core-business-cast`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-core-business-cast/docs/README.md)
- [`pillarbox-player`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-player/docs/README.md)
- [`pillarbox-ui`](https://github.com/SRGSSR/pillarbox-android/blob/main/pillarbox-ui/docs/README.md)
## Contributing
If you want to contribute to the project have a look at our [contributing guide](CONTRIBUTING.md).
## License
See the [LICENSE](../LICENSE) file for more information.