]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/standalone/videos/embed.ts
Translated using Weblate (Galician)
[github/Chocobozzz/PeerTube.git] / client / src / standalone / videos / embed.ts
index dad717108e1b83ddc5185c104f1ec14f9eabec0d..9d1c6c443bad92e490e7c04fcc8eda398aaf838b 100644 (file)
@@ -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 () {
@@ -589,7 +585,7 @@ export class PeerTubeEmbed {
 
     this.buildCSS()
 
-    await this.buildDock(videoInfo)
+    this.buildDock(videoInfo)
 
     this.initializeApi()
 
@@ -657,7 +653,7 @@ export class PeerTubeEmbed {
   }
 
   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)
@@ -665,7 +661,7 @@ export class PeerTubeEmbed {
     }
   }
 
-  private async buildDock (videoInfo: VideoDetails) {
+  private buildDock (videoInfo: VideoDetails) {
     if (!this.controls) return
 
     // On webtorrent fallback, player may have been disposed
@@ -673,7 +669,7 @@ export class PeerTubeEmbed {
 
     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
 
@@ -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)
+  })