Skip to main content
Version: 8.14.0

Migrating from deprecated THEOlive player to THEOplayer on Web

The goal of this guide is to help you migrate from the deprecated theolive player to the recommended THEOplayer. If you haven't integrated with any player, please follow the recommended guide instead of this one.

Dependencies

First remove the old player dependency:

npm uninstall @theolive/player

And replace with theoplayer using:

npm install theoplayer

Setting up a player

Player creation is quite similar, instead of

const player = new THEOLive.Player(element);

Create the player like this:

var player = new THEOplayer.Player(element, {
license: 'your-license',
// This is needed for fallback to work properly
retryConfiguration: {
maxRetries: 6,
},
theoLive: {
// these are optional
externalSessionId: 'my-external-session-id',
fallbackEnabled: true,
},
});

Note that you now need a license, either use the THEOplayer license you had before, or use the one provided in the THEOlive console when creating a channel.

Loading a channel

After setting up your THEOplayer on your web page, we will set the source to a channel. The old way was calling loadChannel on the player.

player.loadChannel('<your-channel-id>').catch(console.error);

With THEOplayer you just set a SourceDescription.

player.source = {
sources: {
type: 'theolive',
src: 'your-channel-id',
},
};

Calling methods and listening to events

Most of the old functionality is right there on THEOplayer and can be found in the THEOplayer docs. For THEOlive specific API, check out player.theolive.

More information