> For the complete documentation index, see [llms.txt](https://docs.chartbeat.com/cbp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chartbeat.com/cbp/tracking/mobile-app-sdks/android-sdk/video-tracking.md).

# Video Tracking

When a video loads in a view, call `trackVideo` to send the video information (see definitions below):

```java
Tracker.trackVideo(
    "/video/123",       // viewId
    "My Video",         // viewTitle
    "https://...jpg",   // thumbnail (may be null)
    0L,                 // engagedTime (seconds)
    300_000L,           // duration (milliseconds)
    "s1",               // playState — see below
    0L,                 // contentTime (seconds)
    0L                  // playerTime (milliseconds)
);
```

Call `updateVideoPlayState` every few seconds while a video is playing to send the current video state.

{% code overflow="wrap" %}

```java
Tracker.updateVideoPlayState(
    "s2",               // playState
    300_000L,           // duration
    12L,                // engagedTime
    45L,                // contentTime    
    45_000L             // playerTime
);
```

{% endcode %}

| viewId      | A string unique identifier for this video, starting with a slash ('/'), similar to a relative path on a website. |
| ----------- | ---------------------------------------------------------------------------------------------------------------- |
| title       | A string title for the content of the video.                                                                     |
| engagedTime | The amount of video played, including ads, in seconds (E).                                                       |
| duration    | The length of the video in milliseconds (\_vd).                                                                  |
| playState   | The play state: "s1" = unplayed, "s2" = played, "s3" = paused/stopped, "s4" = finished (\_vs).                   |
| contentTime | The amount of content played, excluding ads, in seconds (\_vce).                                                 |
| playerTime  | The time reported on the video player, in milliseconds.                                                          |

**Play states**

| Value | Meaning          |
| ----- | ---------------- |
| s1    | Unplayed         |
| s2    | Played           |
| s3    | Paused / stopped |
| s4    | Finished         |
