mirror of
https://gitlab.com/vyla-entertainment/documentation.git
synced 2026-11-15 06:57:21 -05:00
rewrite
This commit is contained in:
@@ -12,14 +12,14 @@ Provider availability and performance can vary based on your network environment
|
||||
|
||||
## How Providers Are Used
|
||||
|
||||
When your app calls `getStream()`—directly or through Stream API:
|
||||
When your app calls `getStream()`-directly or through Stream API:
|
||||
|
||||
1. All active (non-disabled) providers are queried **simultaneously** with per-source random jitter to stagger upstream requests
|
||||
2. Each provider has its own **timeout**, **retry count**, and **backoff delay**
|
||||
3. Every returned URL is **verified** — first via a HEAD request to the raw upstream URL, then via a proxied HLS playability check
|
||||
3. Every returned URL is **verified** - first via a HEAD request to the raw upstream URL, then via a proxied HLS playability check
|
||||
4. Only URLs that pass both verification steps appear in the response as `source` events
|
||||
|
||||
Because the endpoint is SSE, **verified sources are emitted immediately as each provider resolves** — your player receives them progressively. The stream closes once every provider has either resolved or timed out.
|
||||
Because the endpoint is SSE, **verified sources are emitted immediately as each provider resolves** - your player receives them progressively. The stream closes once every provider has either resolved or timed out.
|
||||
|
||||
:::callout-info
|
||||
Call `sdk.getSources(true)` to inspect enabled providers and `sdk.probeAllSources()` for a live availability signal. If you use Stream API, its `/health` endpoint exposes probes over HTTP.
|
||||
@@ -68,7 +68,7 @@ CACHE_TTL = 5 minutes
|
||||
All provider stream URLs are wrapped in the server proxy (unless `skipProxy: true`):
|
||||
|
||||
```
|
||||
http://localhost:7860/api?url=<encoded_stream_url>&<proxyParam>=1
|
||||
http://YOUR_API_URL/api?url=<encoded_stream_url>&<proxyParam>=1
|
||||
```
|
||||
|
||||
When your player fetches this path from your self-hosted instance, the server:
|
||||
@@ -83,5 +83,5 @@ When your player fetches this path from your self-hosted instance, the server:
|
||||
|
||||
Before a URL is emitted as a `source` event, it passes two verification steps:
|
||||
|
||||
1. **`verifyStream`** — a HEAD request to the raw upstream URL. Must return HTTP `< 400`.
|
||||
2. **`verifyPlayable`** — fetches the proxied URL, validates `#EXTM3U`, checks for `#EXTINF` or `#EXT-X-STREAM-INF`, then fetches the first segment.
|
||||
1. **`verifyStream`** - a HEAD request to the raw upstream URL. Must return HTTP `< 400`.
|
||||
2. **`verifyPlayable`** - fetches the proxied URL, validates `#EXTM3U`, checks for `#EXTINF` or `#EXT-X-STREAM-INF`, then fetches the first segment.
|
||||
Reference in New Issue
Block a user