# Video Tracking

```
Chartbeat.trackVideo({
  viewId: '/video/123',
  title: 'My Video',
  thumbnail: 'https://cdn.example.com/thumb.jpg',
  duration: 300,
  playState: 'playing',
  engagedTime: 0,
  contentTime: 0,
  playerTime: 0,
});
```

<table><thead><tr><th width="186.7109375">Name</th><th>Description</th></tr></thead><tbody><tr><td>viewId</td><td>The path of your video. This is a unique identifier that should be used consistently on all pages/platforms where the video is loaded.</td></tr><tr><td>title</td><td>The title of the video.</td></tr><tr><td>thumbnail</td><td>The thumbnail of the video.</td></tr><tr><td>duration</td><td>The duration of the video (in seconds).</td></tr><tr><td>playState</td><td>The play state, 'playing', 'paused', 'complete', 'unplayed'</td></tr><tr><td>engagedTime</td><td>The total time (in seconds) the user has actively engaged with the video up to this point.</td></tr><tr><td>contentTime</td><td>The total time (in seconds) the video content has been consumed.</td></tr><tr><td>playerTime</td><td>The current position of the video playback (in seconds).</td></tr></tbody></table>

{% code overflow="wrap" %}

```
// Periodically update as playback progresses
Chartbeat.updateVideoPlayState(
  'playing',  // playState
  300,        // duration (s)
  12,         // engagedTime (s)
  45,         // contentTime (s)
  45          // playerTime (s)
);
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chartbeat.com/cbp/tracking/mobile-app-sdks/react-native-sdk/video-tracking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
