selectVideoImplementation uses server middleware

This commit is contained in:
nklhrstv 2020-03-16 20:40:07 +02:00
parent 5a6dda4f0d
commit 59c6a69fcb

View file

@ -1,4 +1,4 @@
const { HTMLVideo, YouTubeVideo, MPVVideo } = require('stremio-video');
const { HTMLVideo, YouTubeVideo, MPVVideo, withStreamingServer } = require('stremio-video');
const selectVideoImplementation = (shell, stream) => {
if (shell) {
@ -6,10 +6,12 @@ const selectVideoImplementation = (shell, stream) => {
}
if (stream) {
if (stream.ytId) {
return YouTubeVideo;
} else {
if (typeof stream.url === 'string') {
return HTMLVideo;
} else if (typeof stream.ytId === 'string') {
return YouTubeVideo;
} else if (typeof stream.infoHash === 'string') {
return withStreamingServer(HTMLVideo);
}
}