> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Monitor Bitmovin Player

The FastPix Data SDK with [Bitmovin](https://github.com/FastPix/android-data-bitmovin) helps you track key video metrics like user interactions, playback quality, and performance to enhance the viewing experience. It lets you customize data tracking, monitor streaming quality, and securely send insights for better optimization and error resolution.

### Key features:

* Capture user engagement through detailed viewer interaction data.
* Monitor playback quality with real-time performance analysis.
* Identify and fix video delivery bottlenecks on Android.
* Customize tracking to match specific monitoring needs.
* Handle errors with robust reporting and diagnostics.
* Gain deep insights into video performance with streaming diagnostics.

### Prerequisites:

To track and analyze video performance, initialize the SDK with your Workspace key. Learn about [Workspaces](/getting-started/set-up-a-workspace).

1. Access the FastPix [Dashboard](https://dashboard.fastpix.com/login?redirect=https://dashboard.fastpix.com/): Log in and navigate to the Workspaces section.
2. Locate Your Workspace Key: Copy the Workspace Key for client-side monitoring. Include this key in your Java/Kotlin code on every page where you want to track video performance.

### Install and setup

1. Open your Android Studio project where you want to integrate the SDK.

2. Add the FastPix Data SDK dependency:

3. Navigate to your app-level `build.gradle` file (or `build.gradle.kts` if using Kotlin DSL).

```groovy
implementation "io.fastpix.data:bitmovin:1.0.0"
```

Navigate to your `settings.gradle` file

```groovy
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://maven.pkg.github.com/FastPix/android-data-bitmovin")
            credentials {
                username =
                    project.findProperty("lpr.user")
                password =
                    project.findProperty("lpr.key")
            }
        }
    }
}
```

4. Sync your project with Gradle files
   Click `Sync Now` in the notification bar to download and integrate the FastPix Data SDK.

### Import the SDK

```kotlin
import io.fastpix.data.domain.model.CustomDataDetails
import io.fastpix.data.domain.model.PlayerDataDetails
import io.fastpix.data.domain.model.VideoDataDetails
import io.fastpix.bitmovin_player_data.src.CustomerData
import io.fastpix.bitmovin_player_data.src.FastPixBitMovinPlayer
```

### Integrate with FastPix

1. Ensure that the `workSpaceId` is provided, as it is a mandatory field for FastPix integration, uniquely identifying your workspace. Install and import `FastPixBitMovinPlayer` into your project, and create an `bitmovinData` instance to bind it to. If you are using any other custom player then create an instance of that player.

2. Next, create an instance of `FastPixBitMovinPlayer` to track analytics. After the video URL loads and playback begins, the SDK automatically begins tracking analytics.

```kotlin
import ... 
class MainActivity : AppCompatActivity() { 
    private var bitmovinData: FastPixBitMovinPlayer? = null
} 
```

3. You can initialize BitmovinPlayer with a `BitmovinPlayerView` in your Android application to enable seamless functionality. Use the following Kotlin or Java code in your Android application to configure ExoPlayer with FastPix:

```kotlin
val videoDataDetails = VideoDataDetails(
    videoId = "video-id",
    videoTitle = "video-title",
)
val customerData = CustomerData(
    workSpaceId = "workspace-id",
    videoDetails = videoDataDetails,
    playerData = PlayerDataDetails("player-name", "player-version"),
    customDataDetails = CustomDataDetails(
        customField1 = "field1",
        customField2 = "field2",
        // Add more custom fields as needed
    )
)
bitmovinData = FastPixBitMovinPlayer(
    this,
    binding.bitmovinPlayerView,
    binding.bitmovinPlayerView.player,
    enableLogging = true,
    customerData = customerData
)
```

### Including custom data and metadata

* `workSpaceId` is a mandatory parameter that tells the SDK on which workspace the data will collect.
* `playerView` is another mandatory parameter.

1. You can use custom metadata fields like `customField1` to `customField10` for your business logic, giving you the flexibility to pass any required values. Named attributes, such as `videoId` and `videoTitle`, can be passed directly as they are. See the [user-passable metadata documentation](/video-data/use-custom-dimensions) to see the metadata supported by FastPix.

```kotlin
val videoDataDetails = VideoDataDetails(
    videoId = "video-id",
    videoTitle = "video-title",
    videoSeries = "Video Series",
    videoProducer = "Video Producer",
    videoContentType = "Video Content Type",
    videoVariant = "Video Variant",
    videoLanguage = "Video Language",
    videoDrmType = "Drm Type"
)
val customerData = CustomerData(
    workSpaceId = "workspace-id",
    videoDetails = videoDataDetails,
    beaconUrl = "beacon-url",
    playerData = PlayerDataDetails("bitmovin-player", "bitmovin-version"),
    customDataDetails = CustomDataDetails(
        customField1 = "field1",
        customField2 = "field2",
        // Add more custom fields as needed
    )
)
```

2. To set up video analytics, create a FastPixBitMovinPlayer object by providing the following parameters: your application's `Context` (usually the Activity), the `BotmovinPlayer` instance, and the `customerData`.

```kotlin
bitmovinData = FastPixBitMovinPlayer(
    this,
    binding.bitmovinPlayerView,
    binding.bitmovinPlayerView.player,
    enableLogging = true,
    customerData = customerData
)
```

3. Finally, when destroying the player, make sure to call the `FastPixBitMovinPlayer.release()` function to properly release resources.

```kotlin
override fun onDestroy() { 
  	super.onDestroy() 
	bitmovinData?.release() // Cleanup FastPix tracking 
} 
```

4. After completing the integration, start playing a video in your player. A few minutes after stopping playback, you’ll see the results in your FastPix Video Data dashboard. Log in to the dashboard, navigate to the workspace associated with your `workspace_key`, and look for video views.

### Understanding `CustomerData`

| Field               | Purpose                                                  | Required |
| ------------------- | -------------------------------------------------------- | -------- |
| `workSpaceId`       | Your FastPix workspace identifier                        | ✅        |
| `beaconUrl`         | Optional override tracking endpoint                      | ❌        |
| `videoDetails`      | Metadata describing the video                            | ❌        |
| `playerData`        | Player descriptor (defaults to BitmovinPlayer + version) | ❌        |
| `customDataDetails` | Additional custom tags                                   | ❌        |

### What FastPix Tracks

After initialization, the SDK automatically collects:

| Category        | Examples                                  |
| --------------- | ----------------------------------------- |
| Playback events | play, pause, playing, ended               |
| Buffer events   | buffering, buffered                       |
| Seek behavior   | seeking, seeked                           |
| QoS metrics     | bitrate, resolution, FPS (when available) |
| Errors          | BitmovinPlayer error codes and messages   |
| Player metadata | fullscreen, autoplay, MIME type etc       |

### Example to configure Bitmovin with FastPix Data SDK.

Provide your stream URL in the url field `video-url` and your FastPix workspace key in the workspaceIdfield.

```kotlin
class PlayerActivity : AppCompatActivity() {

    private var bitmovinData: FastPixBitMovinPlayer? = null
    private lateinit var binding: ActivityPlayerBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityPlayerBidning.inflate(layoutInflater)
        setContentView(binding.root)
        val player = Player(context = this)
        binding.bitmovinPlayerView.player = player
        val source = Source(
            SourceConfig(
                url = "video-url",
                type = SourceType.Hls,
                title = "video-title",
            ),
        )
        player.load(source)
        player.play()

        // Initializing FastPix
        val customerData = CustomerData(
            workspaceId = "workspace-id",
            videoDetails = VideoDataDetails(
                "video-id",
                "video-title",
            )
        )
        bitmovinData = FastPixBitMovinPlayer(
            this,
            binding.bitmovinPlayerView,
            binding.bitmovinPlayerView.player,
            enableLogging = true,
            customerData = customerData
        )
    }

    override fun onDestroy() {
        bitmovinData?.release()
        super.onDestroy()
    }
}
```

### Debug Logging

Enable logs using:

```kotlin
enableLogging = true
```

## Troubleshooting

#### SDK Not Tracking Events

* Ensure you've initialized the SDK after configuring Bitmovin Player
* Check that `workSpaceId` is correct
* Verify Bitmovin Player events are firing (check Bitmovin Player logs)
* Enable logging to see FastPix SDK activity

#### Memory Leaks

* Always call `release()` in `onDestroy()`
* Ensure ` bitmovinData?.release()` is called before releasing FastPix SDK

#### Missing Events

* The SDK automatically tracks all events from Bitmovin Player
* Events are tracked based on Bitmovin Player native event system
* Check that Bitmovin player is properly configured and receiving events

\


## Release notes

For a complete release history, including new features, improvements, and bug fixes, see the [FastPix Bitmovin data SDK CHANGELOG on GitHub](https://github.com/FastPix/android-data-bitmovin/blob/main/CHANGELOG.md).

\


### Support

📩 Email: [support@fastpix.io](mailto:support@fastpix.io)
📚 Docs: [fastpix.com/docs](/)