mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
21 lines
709 B
JavaScript
21 lines
709 B
JavaScript
// Copyright (C) 2017-2020 Smart code 203358507
|
|
|
|
const { ChromecastVideo, HTMLVideo, YouTubeVideo, withStreamingServer, withHTMLSubtitles } = require('@stremio/stremio-video');
|
|
|
|
const selectVideoImplementation = (args) => {
|
|
// TODO handle stream.behaviorHints
|
|
// TODO handle IFrameVideo
|
|
// TODO handle MPVVideo
|
|
|
|
if (args.chromecastTransport && args.chromecastTransport.getCastState() === cast.framework.CastState.CONNECTED) {
|
|
return ChromecastVideo;
|
|
}
|
|
|
|
if (args.stream && typeof args.stream.ytId === 'string') {
|
|
return withHTMLSubtitles(YouTubeVideo);
|
|
}
|
|
|
|
return withHTMLSubtitles(withStreamingServer(HTMLVideo));
|
|
};
|
|
|
|
module.exports = selectVideoImplementation;
|