Skip to main content
Version: 11.13.0

Discovery URLs

Before the player can play an OptiView Live channel, it sends a discovery request to find the stream details of that channel (such as its manifest URLs and token security settings). OptiView Live channels are served by one of three discovery API versions:

API versionChannels
V1 (legacy)Channels created with the legacy THEOlive API.
V2Distributions created with the OptiView Live API.
V3Distributions served by the newest discovery API.

The player does not know in advance which API version serves your channel. If you do not configure a discovery URL, the player tries its built-in discovery URLs one by one, in this order:

  1. V2
  2. V1 (legacy)
  3. V3

The player stops at the first discovery URL that returns the channel. If your channel is not served by V2, the earlier requests fail before the right one succeeds. These failed requests add a small delay before playback starts, and they show up as 404 responses in the network tab of your browser or in a network proxy. The 404 responses are expected and do not mean that playback failed.

Why configure a discovery URL​

When you configure the discovery URL that serves your channel, the player sends its first discovery request to that URL. This removes the failed requests and the extra startup delay.

Configured discovery URLs do not replace the built-in discovery URLs. The player tries them first, and continues with the built-in discovery URLs (V2, V1, V3) if the configured ones do not return the channel. A wrong discovery URL therefore costs one extra request, but it does not break playback.

On platforms that support both discoveryUrl and discoveryUrls, the player tries discoveryUrl first, then each URL of discoveryUrls in the order of the list, and then the built-in discovery URLs.

Which discovery URL to use​

The player derives the API version from the path of the discovery URL, so use the URL exactly as listed for your platform, including the trailing /. The URL for V1 channels is different on Web than on the other platforms.

API versionWebAndroid, iOS, Roku
V2https://discovery.theo.live/v2/distributions/https://discovery.theo.live/v2/distributions/
V1 (legacy)https://discovery.theo.live/https://discovery.theo.live/v2/publications/
V3https://discovery.theo.live/v3/https://discovery.theo.live/v3/

React Native and Flutter apps pass the discovery URL to the underlying Web, Android or iOS SDK, so the same rules apply per platform.

Find the API version of your channel

Play your channel without a discovery URL and open the network tab of your browser (or a network proxy for a native app). The discovery request that returns 200 shows the discovery URL that serves your channel. For example, a request to https://discovery.theo.live/v2/distributions/<your-channel-id> means that your channel is served by V2.

Configure the discovery URL​

Set the discovery URL in the theoLive property of the player configuration. For example, for a channel served by V2:

import { THEOplayerView, type PlayerConfiguration } from 'react-native-theoplayer';

const playerConfig: PlayerConfiguration = {
license: 'your-license',
theoLive: {
discoveryUrl: 'https://discovery.theo.live/v2/distributions/',
},
};

<THEOplayerView config={playerConfig} />;

React Native supports one configured discovery URL, which is passed to the Web, Android or iOS SDK. The V2 and V3 discovery URLs are the same on all platforms. For V1 channels, the URL is different on Web (https://discovery.theo.live/) than on Android and iOS (https://discovery.theo.live/v2/publications/), so use Platform.OS to select the right one:

import { Platform } from 'react-native';

const playerConfig: PlayerConfiguration = {
license: 'your-license',
theoLive: {
discoveryUrl: Platform.OS === 'web' ? 'https://discovery.theo.live/' : 'https://discovery.theo.live/v2/publications/',
},
};

Configuration reference​

All properties of TheoLiveConfiguration are optional.

PropertyTypePlatformsDescription
discoveryUrlstringWeb, Android, iOSA discovery URL that the player tries before the built-in discovery URLs.
externalSessionIdstringWeb, Android, iOSAn ID used to report usage analytics.
discoveryHeaderstringWebA value that the player sends in the x-theolive-discovery HTTP header of every discovery request. Only use this if a discovery URL that you configured expects this header, for example your own proxy in front of discovery.
fallbackEnabledbooleanWebWhether the player plays the fallback stream when a V1 channel has a fallback configured. Defaults to true.
analyticsDisabledbooleanAndroidWhether OptiView Live analytics is disabled. Defaults to false.

The default discovery order V2, V1, V3 applies when the app uses THEOplayer 11.13.0 or later.