]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/standalone/videos/embed.html
Don't break player on ice error
[github/Chocobozzz/PeerTube.git] / client / src / standalone / videos / embed.html
CommitLineData
3bb2c7f9
C
1<!DOCTYPE html>
2<html>
3 <head>
3bb2c7f9
C
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
568cd967 6 <meta name="robots" content="noindex">
9fb6cfc4 7 <meta property="og:platform" content="PeerTube" />
3bb2c7f9 8
2a4c9669
C
9 <script type="text/javascript">
10 // Thanks: https://mathiasbynens.be/notes/globalthis
11 (function() {
12 if (typeof globalThis === 'object') return;
13 Object.prototype.__defineGetter__('__magic__', function() {
14 return this;
15 });
16 __magic__.globalThis = __magic__
17 delete Object.prototype.__magic__;
18 }());
19 </script>
20
aea0b0e7
C
21
22 <!-- /!\ The following comment is used by the server to prerender some tags /!\ -->
23
24 <!-- title tag -->
25 <!-- description tag -->
2564d97e 26 <!-- custom css tag -->
aea0b0e7
C
27 <!-- meta tags -->
28 <!-- server config -->
29
30 <!-- /!\ Do not remove it /!\ -->
31
1c6c7699 32 <link rel="icon" type="image/png" href="/client/assets/images/favicon.png" />
3bb2c7f9
C
33 </head>
34
ecc69f6b 35 <body id="custom-css" class="standalone-video-embed">
3bb2c7f9 36
d4f3fea6 37 <div id="error-block">
ad3fa0c5 38 <h1 id="error-title"></h1>
d4f3fea6
C
39
40 <div id="error-content"></div>
41 </div>
42
5abc96fc 43 <div id="video-wrapper"></div>
3bb2c7f9 44
5abc96fc 45 <div id="placeholder-preview"></div>
3f9c4955 46
c21a0aa8
C
47 <script type="text/javascript">
48 // Can be called in embed.ts
49 window.displayIncompatibleBrowser = function () {
50 const text = 'The player is not compatible with your web browser. Please try latest Firefox version.'
51
52 document.title = 'Sorry' + ' - ' + text
53
54 const errorBlock = document.getElementById('error-block')
55 errorBlock.style.display = 'flex'
56
57 const errorTitle = document.getElementById('error-title')
58 errorTitle.innerHTML = 'Sorry'
59
60 const errorText = document.getElementById('error-content')
61 errorText.innerHTML = text
c7c6afc6
C
62
63 const videoWrapper = document.getElementById('video-wrapper')
64 if (videoWrapper) videoWrapper.style.display = 'none'
65
66 const placeholderPreview = document.getElementById('placeholder-preview')
67 if (placeholderPreview) placeholderPreview.style.display = 'none'
c21a0aa8
C
68 }
69
da8637ba
C
70 window.onerror = function (msg) {
71 if (typeof msg === 'string' && msg.toLowerCase().includes(' ice ')) {
72 console.warn(msg)
73 return
74 }
75
c21a0aa8
C
76 window.displayIncompatibleBrowser()
77 }
78
79 if (/MSIE|Trident/.test(window.navigator.userAgent) ) {
80 window.displayIncompatibleBrowser()
81 }
82 </script>
83
3bb2c7f9 84 </body>
7a7724e6 85</html>