}
async init () {
- try {
- this.userTokens = Tokens.load()
- await this.initCore()
- } catch (e) {
- console.error(e)
- }
+ this.userTokens = Tokens.load()
+ await this.initCore()
}
private initializeApi () {
this.buildCSS()
- await this.buildDock(videoInfo)
+ this.buildDock(videoInfo)
this.initializeApi()
}
private handleError (err: Error, translations?: { [ id: string ]: string }) {
- if (err.message.indexOf('from xs param') !== -1) {
+ if (err.message.includes('from xs param')) {
this.player.dispose()
this.playerElement = null
this.displayError('This video is not available because the remote instance is not responding.', translations)
}
}
- private async buildDock (videoInfo: VideoDetails) {
+ private buildDock (videoInfo: VideoDetails) {
if (!this.controls) return
// On webtorrent fallback, player may have been disposed
const title = this.title ? videoInfo.name : undefined
- const description = this.config.tracker.enabled && this.warningTitle
+ const description = this.warningTitle && (!videoInfo.isLocal || this.config.tracker.enabled)
? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>'
: undefined
}
PeerTubeEmbed.main()
- .catch(err => console.error('Cannot init embed.', err))
+ .catch(err => {
+ (window as any).displayIncompatibleBrowser()
+
+ console.error('Cannot init embed.', err)
+ })