mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
selectVideoImplementation updated
This commit is contained in:
parent
94bef3e064
commit
254e34b01b
1 changed files with 10 additions and 8 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue