]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/standalone/videos/embed.html
Display avatar in embed poster
[github/Chocobozzz/PeerTube.git] / client / src / standalone / videos / embed.html
index 5a15bf552e845ad41cf5fbfe5fe8de4e9b99901e..f30dda96b4bba5d64d9e454005cb79e5c4921f1d 100644 (file)
@@ -1,17 +1,38 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <title>PeerTube</title>
-
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <meta name="robots" content="noindex">
     <meta property="og:platform" content="PeerTube" />
 
+    <script type="text/javascript">
+    // Thanks: https://mathiasbynens.be/notes/globalthis
+    (function() {
+      if (typeof globalThis === 'object') return;
+      Object.prototype.__defineGetter__('__magic__', function() {
+        return this;
+      });
+      __magic__.globalThis = __magic__
+      delete Object.prototype.__magic__;
+    }());
+    </script>
+
+
+    <!-- /!\ The following comment is used by the server to prerender some tags /!\ -->
+
+    <!-- title tag -->
+    <!-- description tag -->
+    <!-- custom css tag -->
+    <!-- meta tags -->
+    <!-- server config -->
+
+    <!-- /!\ Do not remove it /!\ -->
+
     <link rel="icon" type="image/png" href="/client/assets/images/favicon.png" />
   </head>
 
-  <body id="custom-css">
+  <body id="custom-css" class="standalone-video-embed">
 
     <div id="error-block">
       <h1 id="error-title"></h1>
       <div id="error-content"></div>
     </div>
 
-    <video playsinline="true" id="video-container" class="video-js vjs-peertube-skin">
-    </video>
+    <div id="video-wrapper"></div>
+
+    <div id="placeholder-preview"></div>
+
+    <script type="text/javascript">
+      // Can be called in embed.ts
+      window.displayIncompatibleBrowser = function () {
+        const text = 'The player is not compatible with your web browser. Please try latest Firefox version.'
+
+        document.title = 'Sorry' + ' - ' + text
+
+        const errorBlock = document.getElementById('error-block')
+        errorBlock.style.display = 'flex'
+
+        const errorTitle = document.getElementById('error-title')
+        errorTitle.innerHTML = 'Sorry'
+
+        const errorText = document.getElementById('error-content')
+        errorText.innerHTML = text
+
+        const videoWrapper = document.getElementById('video-wrapper')
+        if (videoWrapper) videoWrapper.style.display = 'none'
+
+        const placeholderPreview = document.getElementById('placeholder-preview')
+        if (placeholderPreview) placeholderPreview.style.display = 'none'
+      }
+
+      window.onerror = function () {
+        window.displayIncompatibleBrowser()
+      }
+
+      if (/MSIE|Trident/.test(window.navigator.userAgent) ) {
+        window.displayIncompatibleBrowser()
+      }
+    </script>
 
   </body>
 </html>