mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 03:22:11 +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 { ChromecastSenderVideo, HTMLVideo, YouTubeVideo, withStreamingServer, withHTMLSubtitles } = require('@stremio/stremio-video');
|
||||||
|
|
||||||
const selectVideoImplementation = (args) => {
|
const selectVideoImplementation = (args) => {
|
||||||
// TODO handle stream.behaviorHints
|
if (!args.stream || typeof args.stream.externalUrl === 'string') {
|
||||||
// TODO handle IFrameVideo
|
return null;
|
||||||
// TODO handle MPVVideo
|
}
|
||||||
|
|
||||||
if (args.chromecastTransport && args.chromecastTransport.getCastState() === cast.framework.CastState.CONNECTED) {
|
if (args.chromecastTransport && args.chromecastTransport.getCastState() === cast.framework.CastState.CONNECTED) {
|
||||||
return ChromecastSenderVideo;
|
return ChromecastSenderVideo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.stream && typeof args.stream.ytId === 'string') {
|
if (typeof args.stream.ytId === 'string') {
|
||||||
return withHTMLSubtitles(YouTubeVideo);
|
return withHTMLSubtitles(YouTubeVideo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof args.stream.playerFrameUrl === 'string') {
|
||||||
|
// TODO return IFrameVideo;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof args.streamingServerURL === 'string') {
|
if (typeof args.streamingServerURL === 'string') {
|
||||||
return withStreamingServer(withHTMLSubtitles(HTMLVideo));
|
return withStreamingServer(withHTMLSubtitles(HTMLVideo));
|
||||||
}
|
}
|
||||||
|
|
||||||
return withHTMLSubtitles(HTMLVideo);
|
if (typeof args.stream.url === 'string') {
|
||||||
|
return withHTMLSubtitles(HTMLVideo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = selectVideoImplementation;
|
module.exports = selectVideoImplementation;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue