/

# Bitmovin Android Player

The Bitmovin Android Player internally consists of multiple modules that aren't meant to be included directly. Only the top-level `player` module should be included in your project.

The `player` can be included with Gradle by adding the following to your `build.gradle.kts` file:

```kotlin
    implementation("com.bitmovin.player:player:$bitmovinPlayerVersion")
```

## Optional dependencies:

### IMA Advertising

In order to use the IMA advertising integration, the following dependencies must be added manually.\
Additionally it is important, to use the `+jason` build flavor of the Bitmovin Player and enable `coreLibraryDesugaring`.

```kotlin
android {
    compileOptions {
        setCoreLibraryDesugaringEnabled(true)
    }
}

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'

    implementation("com.google.ads.interactivemedia.v3:interactivemedia:3.38.0")
    implementation("com.bitmovin.player:player:${bitmovinPlayerVersion}+jason")
}
```

The `Bitmovin` and the `Progressive` advertising feature do not require any additional dependencies.

### Casting

In order to use casting functionality, the following dependency must be added manually

```kotlin
    implementation("com.google.android.gms:play-services-cast-framework:21.4.0")
```

### Offline playback

In order to use offline functionality, the following dependency must be added manually

```kotlin
    implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0")
```

The following additional permissions are required in the manifest

```kotlin
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
```

When targeting Android 13 (API level 33) and above, the following permission has to be declared in the manifest and  requested at runtime before starting downloads Without that permission granted by the user, notifications posted by  the download service are not displayed.  See https://developer.android.com/develop/ui/views/notifications/notification-permission for more details.

```kotlin
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
```

When targeting Android 14 (API level 34)  and above, the following permission is also required to enable downloading assets while the app is in the background.  See https://developer.android.com/about/versions/14/changes/fgs-types-required#data-sync for more details.

```kotlin
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
```

### Media Session

In order to use the Bitmovin media session integration, the following dependency must be added:

```kotlin
    implementation("com.bitmovin.player:player-media-session:<bitmovin-player-version>")
```

For more details read the `player-media-session` module description.

## Additional resources:

- 
   [Getting started](https://bitmovin.com/docs/player/getting-started/android)
- 
   [V2 -> V3 migration guide](https://bitmovin.com/docs/player/tutorials/migration-guide-android-sdk-v2-to-v3)
- 
   [Samples repository](https://github.com/bitmovin/bitmovin-player-android-samples)
- 
   [Release notes](https://bitmovin.com/release-notes-android-sdk/)

## All modules:

| Name |
|---|
| [player](player/index.md) |  |
| [player-analytics](player-analytics/index.md) | The `player-analytics` module provides an integration for the [Bitmovin Analytics Collector](https://github.com/bitmovin/bitmovin-analytics-collector-android#bitmovin-player). |
| [player-core](player-core/index.md) | The `player-core` module contains all non web UI related API of the Bitmovin Android Player SDK. |
| [player-media-session](player-media-session/index.md) | The `player-media-session` module provides an integration for Android Media Sessions. |
| [player-ui-web](player-ui-web/index.md) | The `player-ui-web` module provides an integration for the [Bitmovin Player Web UI](https://github.com/bitmovin/bitmovin-player-ui). It comes with a com.bitmovin.player.PlayerView and default UI handling to an attached com.bitmovin.player.api.Player instance. |