# Using a custom player for streaming

### Fetch the streaming URLs <a href="#page_fetch_the_streaming_urls" id="page_fetch_the_streaming_urls"></a>

With our client-side rest API, you can fetch all data provided for a file or live-stream in easy way. For protection you need to generate a key as described [here](/player-web-sdk/basic-usage.md).

You can fetch the streaming URLs with the following URL. Please do not forget to replace the macro parameters with your own data.

```
https://playout.3qsdn.com/config/[DATAID]?key=[KEY]&timestamp=[TIMESTAMP]
```

**Error Status codes** If your token is not correct or the video is not published, you’ll get certain status codes which you have to handle.

* 200: Everything is okay
* 404: File does not exists
* 403: Token is not correct
* 401: Geo-Blocked
* 410: File is not published (releaseStatus)

After you called the URL, you’ll receive a JSON file which looks like this, it provides also metadata, etc.

{% hint style="info" %}
If your project is using content protection, the call to this JSON must have exactly the same user agent header as the player.
{% endhint %}

```json
{
  "dataid": "a719ecb1-b61f-11ea-97a4-002590c750be",
  ...
  "streamContent": "demand",
  "streamType": "video",
  "sources": {
    "hls": "https://sdn-global-streaming-cache.3qsdn.com/stream/.../manifest.m3u8",
    "dash": "https://sdn-global-streaming-cache.3qsdn.com/stream/.../manifest.mpd",
    "progressive": [
      {
        "src": "https://sdn-global-prog-cache.3qsdn.com/stream/.../57-XW8JQvNYrxfMHFBDqd9k.mp4",
        "type": "video/mp4",
        "height": 720
      },
      {
        "src": "https://sdn-global-prog-cache.3qsdn.com/stream/.../6-ZN2XYHqhdjtvC6M7PKD3.mp4",
        "type": "video/mp4",
        "height": 144
      },
      {
        "src": "https://sdn-global-prog-cache.3qsdn.com/stream/.../5-nGK4F8hVpX3RdBCWtDm6.mp4",
        "type": "video/mp4",
        "height": 240
      },
      {
        "src": "https://sdn-global-prog-cache.3qsdn.com/stream/.../4-KP6vg7JY2Rc9F3XDZxzr.mp4",
        "type": "video/mp4",
        "height": 360
      },
      {
        "src": "https://sdn-global-prog-cache.3qsdn.com/stream/.../3-v7rxNPKYDzgLH9Vtb3Gj.mp4",
        "type": "video/mp4",
        "height": 480
      },
      {
        "src": "https://sdn-global-prog-cache.3qsdn.com/stream/.../2-cMJT4DCB8drvPYRhz7x6.mp4",
        "type": "video/mp4",
        "height": 720
      }
    ]
  }
  ...
}
```

As you can see in the example, you can now pick up the URLs you need and put them in the custom player. We always suggest to use streaming formats (HLS, DASH) instead of progressive download.


---

# 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://player.docs.3q.video/knowledge-base/using-a-custom-player-for-streaming.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.
