> For the complete documentation index, see [llms.txt](https://docs.thesports.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thesports.com/help-center/live-experiences/video-streaming-service-integration.md).

# Video streaming service integration

### How to use the Video API endpoint?

The **Video** API endpoint is used to retrieve the video stream for each match. To obtain match details such as the schedule, status, and score, use the **Schedule and Results** API endpoint configured in the console.

The **Schedule and Results** API endpoint returns all schedules for the date specified by the request parameter. Use the `match id` to associate the schedule data with the data returned by the **Video** API endpoint.

### How to handle deleted videos?

Some matches may experience playback problems, such as freezing or failure to play. If no backup signal is available, TheSports may remove the corresponding video.

When a video is removed, the match is no longer returned by the **Video** API endpoint. Compare two consecutive responses from the **Video** API endpoint to detect this change. If a match is present in the previous response but absent from the subsequent response, its video has been removed. Your application should handle this case accordingly.

### Recommended video playback logic

Use the match schedule or the `match status` field from the **Real-time data** API endpoint to control video playback:

* Start playback when the match status is 'In Progress':

| match status | description       |
| ------------ | ----------------- |
| 2            | First half        |
| 3            | Half-time         |
| 4            | Second half       |
| 5            | Overtime          |
| 7            | Penalty Shoot-out |

* Stop playback when the match status is 'Complete':

| match status | description              |
| ------------ | ------------------------ |
| 0            | Abnormal(suggest hiding) |
| 8            | End                      |
| 10           | Interrupt                |
| 11           | Cut in half              |
| 12           | Cancel                   |
| 13           | To be determined         |

### How to play videos for specific competitions?

The **Video** API endpoint returns videos for all matches and does not support filtering by competition. Filter the data locally as follows:

1. Use the `competition_id` in the schedule data to identify the `match_id` values for the required competition.
2. Retrieve data from the **Video** API endpoint.
3. Save and play only the video records whose `match_id` matches one of the required matches. Do not save or play videos for other matches.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.thesports.com/help-center/live-experiences/video-streaming-service-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
