mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
update select video impl function
This commit is contained in:
parent
28cdc85512
commit
ee58baa7a8
1 changed files with 14 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue