diff --git a/src/routes/Player/Video/selectVideoImplementation.js b/src/routes/Player/Video/selectVideoImplementation.js index 1c1184ab8..17be8c550 100644 --- a/src/routes/Player/Video/selectVideoImplementation.js +++ b/src/routes/Player/Video/selectVideoImplementation.js @@ -3,23 +3,32 @@ const { ChromecastSenderVideo, HTMLVideo, YouTubeVideo, withStreamingServer, withHTMLSubtitles } = require('@stremio/stremio-video'); const selectVideoImplementation = (args) => { - // TODO handle stream.behaviorHints - // TODO handle IFrameVideo - // TODO handle MPVVideo + if (!args.stream || typeof args.stream.externalUrl === 'string') { + return null; + } if (args.chromecastTransport && args.chromecastTransport.getCastState() === cast.framework.CastState.CONNECTED) { return ChromecastSenderVideo; } - if (args.stream && typeof args.stream.ytId === 'string') { + if (typeof args.stream.ytId === 'string') { return withHTMLSubtitles(YouTubeVideo); } + if (typeof args.stream.playerFrameUrl === 'string') { + // TODO return IFrameVideo; + return null; + } + if (typeof args.streamingServerURL === 'string') { return withStreamingServer(withHTMLSubtitles(HTMLVideo)); } - return withHTMLSubtitles(HTMLVideo); + if (typeof args.stream.url === 'string') { + return withHTMLSubtitles(HTMLVideo); + } + + return null; }; module.exports = selectVideoImplementation;