selectVideoImplementation updated

This commit is contained in:
nklhrstv 2020-04-30 13:47:03 +03:00
parent 94bef3e064
commit 254e34b01b

View file

@ -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));
}
}