react-native-theoplayer
Version:
A THEOplayer video component for react-native.
33 lines (32 loc) • 948 B
JavaScript
;
export class TheoLiveWebAdapter {
constructor(_player) {
this._player = _player;
}
get currentLatency() {
const currentLatency = this._player.latency.currentLatency;
return currentLatency ? Promise.resolve(currentLatency) : Promise.reject('latency not available');
}
get latencies() {
const webLatencies = this._player.hesp?.latencies;
if (webLatencies) {
return Promise.resolve({
engineLatency: webLatencies?.engine,
distributionLatency: webLatencies?.distribution,
playerLatency: webLatencies?.player,
theoliveLatency: webLatencies?.theolive
});
} else {
return Promise.reject('latencies not available');
}
}
set authToken(token) {
if (this._player.theoLive) {
this._player.theoLive.authToken = token;
}
}
get authToken() {
return this._player.theoLive?.authToken;
}
}
//# sourceMappingURL=TheoLiveWebAdapter.js.map