From 254e34b01b43e6f71b5b79deed4588aaa81d7ef9 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Thu, 30 Apr 2020 13:47:03 +0300 Subject: [PATCH] selectVideoImplementation updated --- .../Player/Video/selectVideoImplementation.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/routes/Player/Video/selectVideoImplementation.js b/src/routes/Player/Video/selectVideoImplementation.js index c84586a10..787b5378d 100644 --- a/src/routes/Player/Video/selectVideoImplementation.js +++ b/src/routes/Player/Video/selectVideoImplementation.js @@ -1,19 +1,21 @@ // Copyright (C) 2017-2020 Smart code 203358507 -const { HTMLVideo, YouTubeVideo, MPVVideo, withStreamingServer } = require('stremio-video'); +const { HTMLVideo, YouTubeVideo, MPVVideo, withStreamingServer, withHTMLSubtitles } = require('stremio-video'); const selectVideoImplementation = (shell, stream) => { + // TODO handle stream.behaviorHints + // TODO handle IFrameVideo + // TODO handle ChromecastVideo + if (shell) { - return MPVVideo; + return withHTMLSubtitles(withStreamingServer(MPVVideo)); } if (stream) { - if (typeof stream.url === 'string') { - return HTMLVideo; - } else if (typeof stream.ytId === 'string') { - return YouTubeVideo; - } else if (typeof stream.infoHash === 'string') { - return withStreamingServer(HTMLVideo); + if (typeof stream.ytId === 'string') { + return withHTMLSubtitles(YouTubeVideo); + } else if (typeof stream.url === 'string' || typeof stream.infoHash === 'string') { + return withHTMLSubtitles(withStreamingServer(HTMLVideo)); } }