update select video impl function

This commit is contained in:
nklhrstv 2021-09-01 16:45:30 +03:00
parent 28cdc85512
commit ee58baa7a8

View file

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