# Player API

## Getting Started

You should use this endpoint if you would like to integrate our video streaming player into your desktop site.

{% hint style="danger" %}
We strongly recommend that you do not use our Player Endpoint for any mobile or app integrations. For these integrations, we recommend using a native player and integrating with our Streaming API. See [this page](/streaming-integration/apis/streaming-api/recommended-open-source-players.md) for more details.
{% endhint %}

In order to user the Player API, you need to understand how to create an authentication token and timestamp using your Operator ID and Secret. For information on this please see the [Token Creation](/streaming-integration/authentication/token-creation.md) page.

The Player API will play the stream in a HTML player.

## Integration Steps

1. Request a token from your client application to your server
2. Generate an authentication token server-side
3. Embed the Player API onto the page with the appropriate parameters, including the authentication token

These steps are detailed, along with a diagram, in the[ Authentication Flow](/streaming-integration/authentication/authentication-flow.md) section of this documentation.

## Player

<mark style="color:blue;">`GET`</mark> `https://api.livestreaming.srarena.io/api/v2/streaming/events/{eventId}/player` \
(was: `https://api.livestreaming.imgarena.com/api/v2/streaming/events/{eventId}/player`)

The Player API is embedded on a page using an iFrame with the above source URL, where {eventId} is the ID of the event that you would like to play.

#### Query Parameters

| Name       | Type    | Description                                                                                                                                                                                               |
| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| operatorId | integer | Your company's identifier. This is provided to you by the integrations team.                                                                                                                              |
| auth       | string  | The API token for this request. Please see "Token Creation" for more information on how to generate a token.                                                                                              |
| timestamp  | integer | The timestamp linked to the API token for this request. The timestamp value is the number of milliseconds since the Unix epoch, i.e the number of milliseconds since midnight (UTC) on January 1st, 1970. |
| controls   | boolean | If "true", the player will show UI controls. Default controls are; play/pause, volume/mute. Default is true.                                                                                              |
| mute       | boolean | If "true", the player will be initially loaded on mute. Default is false.                                                                                                                                 |
| autoPlay   | boolean | If "true", the stream will automatically start playing upon the player loading. Default is true.                                                                                                          |

{% tabs %}
{% tab title="200 If successful, the player API will return an embeddable player within the iFrame. " %}

```
<iframe 
src="http://api.livestreaming.srarena.io/api/v2/streaming/events/{eventId}/player?operatorId=2&auth=e426d794a03954125a9da613d8132107&timestamp=1380022726594" 
style="border:none;padding:0;margin:0;height:360px;width:640px;">
</iframe>
```

(`http://api.livestreaming.imgarena.com/api/v2/streaming/events/{eventId}/player?operatorId=2&auth=e426d794a03954125a9da613d8132107&timestamp=1380022726594`)
{% endtab %}
{% endtabs %}

## Example iFrame embed

```markup
<iframe 
src="http://api.livestreaming.srarena.io/api/v2/streaming/events/{eventId}/player?operatorId=2&auth=e426d794a03954125a9da613d8132107&timestamp=1380022726594" 
style="border:none;padding:0;margin:0;height:360px;width:640px;">
</iframe>
```

(`http://api.livestreaming.imgarena.com/api/v2/streaming/events/{eventId}/player?operatorId=2&auth=e426d794a03954125a9da613d8132107&timestamp=1380022726594`)


---

# 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.sportradar.com/streaming-integration/apis/player-api.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.
