From c21a0aa855f61daaca458e16b47f95278898beb4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 2 Sep 2021 09:31:07 +0200 Subject: [PATCH] Display a message in embed on unsupported web browser --- client/src/standalone/videos/embed.html | 26 +++++++++++++++++++++++++ client/src/standalone/videos/embed.ts | 14 ++++++------- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/client/src/standalone/videos/embed.html b/client/src/standalone/videos/embed.html index 3455b4aa4..8ec03d199 100644 --- a/client/src/standalone/videos/embed.html +++ b/client/src/standalone/videos/embed.html @@ -44,5 +44,31 @@
+ + diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 36480922e..a6f0b2ed9 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -258,12 +258,8 @@ export class PeerTubeEmbed { } async init () { - try { - this.userTokens = Tokens.load() - await this.initCore() - } catch (e) { - console.error(e) - } + this.userTokens = Tokens.load() + await this.initCore() } private initializeApi () { @@ -791,4 +787,8 @@ export class PeerTubeEmbed { } PeerTubeEmbed.main() - .catch(err => console.error('Cannot init embed.', err)) + .catch(err => { + (window as any).displayIncompatibleBrowser() + + console.error('Cannot init embed.', err) + })