Fix old edge HLS compat
authorChocobozzz <me@florianbigard.com>
Wed, 13 May 2020 08:39:54 +0000 (10:39 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 13 May 2020 08:39:54 +0000 (10:39 +0200)
client/src/app/videos/+video-watch/video-watch.component.ts

index 51e48427501e1510a8676dda93d19345777b6eae..3790c7f6aa6bdbfb8a8502c18cbaaea15e0dbacf 100644 (file)
@@ -717,6 +717,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
       else mode = 'webtorrent'
     }
 
+    // p2p-media-loader needs TextEncoder, try to fallback on WebTorrent
+    if (typeof TextEncoder === 'undefined') {
+      mode = 'webtorrent'
+    }
+
     if (mode === 'p2p-media-loader') {
       const hlsPlaylist = video.getHlsPlaylist()