aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/embed.html
blob: eab6f81a66ff367d4d06d5367fd228e5fad53c61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
  <head>
    <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" class="standalone-video-embed">

    <div id="error-block">
      <h1 id="error-title"></h1>

      <div id="error-content"></div>
    </div>

    <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 (msg) {
        if (typeof msg === 'string' && msg.toLowerCase().includes(' ice ')) {
          console.warn(msg)
          return
        }

        window.displayIncompatibleBrowser()
      }

      if (/MSIE|Trident/.test(window.navigator.userAgent) ) {
        window.displayIncompatibleBrowser()
      }
    </script>

  </body>
</html>