From 6ec0b75beb9c8bcd84e178912319913b91830da2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Feb 2019 10:39:50 +0100 Subject: Fallback HLS to webtorrent --- client/src/standalone/videos/embed.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'client/src/standalone/videos/embed.ts') diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 1e58d42d9..c5c46d0c5 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -311,7 +311,10 @@ class PeerTubeEmbed { videoCaptions, inactivityTimeout: 1500, videoViewUrl: this.getVideoUrl(videoId) + '/views', + playerElement: this.videoElement, + onPlayerElementChange: (element: HTMLVideoElement) => this.videoElement = element, + videoDuration: videoInfo.duration, enableHotkeys: true, peertubeLink: true, @@ -321,6 +324,10 @@ class PeerTubeEmbed { serverUrl: window.location.origin, language: navigator.language, embedUrl: window.location.origin + videoInfo.embedPath + }, + + webtorrent: { + videoFiles: videoInfo.files } } @@ -336,12 +343,6 @@ class PeerTubeEmbed { videoFiles: videoInfo.files } as P2PMediaLoaderOptions }) - } else { - Object.assign(options, { - webtorrent: { - videoFiles: videoInfo.files - } - }) } this.player = await PeertubePlayerManager.initialize(this.mode, options) -- cgit v1.2.3