mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
update stremio-video
This commit is contained in:
parent
ee58baa7a8
commit
de5a131eb1
4 changed files with 33 additions and 74 deletions
63
package-lock.json
generated
63
package-lock.json
generated
|
|
@ -8140,18 +8140,19 @@
|
|||
"integrity": "sha512-knlcBibqJW2mbEgid6YEeQN9FPkIGAEtozYWqzKWeHd2DPY2nl8kYX2pMQpa2Db/RVSqbVstu/gdey5TtSgGYw=="
|
||||
},
|
||||
"@stremio/stremio-video": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@stremio/stremio-video/-/stremio-video-0.0.7.tgz",
|
||||
"integrity": "sha512-91A90edymp58m3HuH53gfrcLuO6izJdCpPSaTy4/ycBKApfhPBwTeaKV0bHN+RLDLDHOwqAllfkiN3YdtoJ7+Q==",
|
||||
"version": "0.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@stremio/stremio-video/-/stremio-video-0.0.9.tgz",
|
||||
"integrity": "sha512-xGh3X6WtHAJf3N6mZVhmnsoQETOo9hk9/d3Z1g85IrKDqOFRjbHUQ07JMDOmsUAXWnSOFElgMBluVJrT1VO7LQ==",
|
||||
"requires": {
|
||||
"deep-freeze": "0.0.1",
|
||||
"events": "1.1.1",
|
||||
"hls.js": "0.14.16",
|
||||
"eventemitter3": "4.0.7",
|
||||
"hat": "0.0.3",
|
||||
"hls.js": "1.0.10",
|
||||
"lodash.clonedeep": "4.5.0",
|
||||
"magnet-uri": "5.2.4",
|
||||
"magnet-uri": "6.2.0",
|
||||
"url": "0.11.0",
|
||||
"video-name-parser": "1.4.6",
|
||||
"vtt.js": "0.13.0"
|
||||
"vtt.js": "git://github.com/jaruba/vtt.js.git#e4f5f5603730866bacb174a93f51b734c9f29e6a"
|
||||
}
|
||||
},
|
||||
"@testing-library/dom": {
|
||||
|
|
@ -10182,6 +10183,11 @@
|
|||
"tweetnacl": "^0.14.3"
|
||||
}
|
||||
},
|
||||
"bep53-range": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/bep53-range/-/bep53-range-1.1.1.tgz",
|
||||
"integrity": "sha512-ct6s33iiwRCUPp9KXnJ4QMWDgHIgaw36caK/5XEQ9L8dCzSQlJt1Vk6VmHh1VD4AlGCAI4C2zmtfItifBBPrhQ=="
|
||||
},
|
||||
"better-opn": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/better-opn/-/better-opn-2.1.1.tgz",
|
||||
|
|
@ -13833,11 +13839,6 @@
|
|||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
|
||||
},
|
||||
"events": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
|
||||
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ="
|
||||
},
|
||||
"eventsource": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz",
|
||||
|
|
@ -15262,6 +15263,11 @@
|
|||
"space-separated-tokens": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"hat": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/hat/-/hat-0.0.3.tgz",
|
||||
"integrity": "sha1-uwFKnmSzeIrtgAWRdBPU/z1QLYo="
|
||||
},
|
||||
"he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
|
|
@ -15281,13 +15287,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"hls.js": {
|
||||
"version": "0.14.16",
|
||||
"resolved": "https://registry.npmjs.org/hls.js/-/hls.js-0.14.16.tgz",
|
||||
"integrity": "sha512-VACiO99DQFBpflR4fI+6GVHUZn35R0SGGQo0XTDZOm2BUXbeuDHTghTC/k2/3wGln6KBmG8/bXIcDIzDsY2UEg==",
|
||||
"requires": {
|
||||
"eventemitter3": "^4.0.3",
|
||||
"url-toolkit": "^2.1.6"
|
||||
}
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.0.10.tgz",
|
||||
"integrity": "sha512-P+o/wjGJsnqwdXXYfWvopOceXEXFV0H8vs/T+ApsscP/GlpUtdIRWie7qc+jbml95ThjE6+FVci9VGaD51r/6Q=="
|
||||
},
|
||||
"hmac-drbg": {
|
||||
"version": "1.0.1",
|
||||
|
|
@ -17411,12 +17413,12 @@
|
|||
}
|
||||
},
|
||||
"magnet-uri": {
|
||||
"version": "5.2.4",
|
||||
"resolved": "https://registry.npmjs.org/magnet-uri/-/magnet-uri-5.2.4.tgz",
|
||||
"integrity": "sha512-VYaJMxhr8B9BrCiNINUsuhaEe40YnG+AQBwcqUKO66lSVaI9I3A1iH/6EmEwRI8OYUg5Gt+4lLE7achg676lrg==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/magnet-uri/-/magnet-uri-6.2.0.tgz",
|
||||
"integrity": "sha512-O9AgdDwT771fnUj0giPYu/rACpz8173y8UXCSOdLITjOVfBenZ9H9q3FqQmveK+ORUMuD+BkKNSZP8C3+IMAKQ==",
|
||||
"requires": {
|
||||
"thirty-two": "^1.0.1",
|
||||
"uniq": "^1.0.1"
|
||||
"bep53-range": "^1.1.0",
|
||||
"thirty-two": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
|
|
@ -23122,7 +23124,8 @@
|
|||
"uniq": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz",
|
||||
"integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8="
|
||||
"integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=",
|
||||
"dev": true
|
||||
},
|
||||
"uniqs": {
|
||||
"version": "2.0.0",
|
||||
|
|
@ -23289,11 +23292,6 @@
|
|||
"requires-port": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"url-toolkit": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/url-toolkit/-/url-toolkit-2.2.1.tgz",
|
||||
"integrity": "sha512-8+DzgrtDZYZGhHaAop5WGVghMdCfOLGbhcArsJD0qDll71FXa7EeKxi2hilPIscn2nwMz4PRjML32Sz4JTN0Xw=="
|
||||
},
|
||||
"use": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
|
||||
|
|
@ -23465,9 +23463,8 @@
|
|||
"dev": true
|
||||
},
|
||||
"vtt.js": {
|
||||
"version": "0.13.0",
|
||||
"resolved": "https://registry.npmjs.org/vtt.js/-/vtt.js-0.13.0.tgz",
|
||||
"integrity": "sha1-lVxmezTVMlsgEsuei6m61uCxH/g="
|
||||
"version": "git://github.com/jaruba/vtt.js.git#e4f5f5603730866bacb174a93f51b734c9f29e6a",
|
||||
"from": "git://github.com/jaruba/vtt.js.git#e4f5f5603730866bacb174a93f51b734c9f29e6a"
|
||||
},
|
||||
"w3c-hr-time": {
|
||||
"version": "1.0.2",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
"@stremio/stremio-colors": "4.0.1",
|
||||
"@stremio/stremio-core-web": "0.23.0",
|
||||
"@stremio/stremio-icons": "3.0.5",
|
||||
"@stremio/stremio-video": "0.0.7",
|
||||
"@stremio/stremio-video": "0.0.9",
|
||||
"a-color-picker": "1.2.1",
|
||||
"buffer": "6.0.3",
|
||||
"classnames": "2.2.6",
|
||||
|
|
|
|||
|
|
@ -3,9 +3,8 @@
|
|||
const React = require('react');
|
||||
const PropTypes = require('prop-types');
|
||||
const classnames = require('classnames');
|
||||
const { StremioVideo } = require('@stremio/stremio-video');
|
||||
const StremioVideo = require('@stremio/stremio-video');
|
||||
const { useLiveRef } = require('stremio/common');
|
||||
const selectVideoImplementation = require('./selectVideoImplementation');
|
||||
const styles = require('./styles');
|
||||
|
||||
const Video = React.forwardRef(({ className, ...props }, ref) => {
|
||||
|
|
@ -30,10 +29,7 @@ const Video = React.forwardRef(({ className, ...props }, ref) => {
|
|||
React.useImperativeHandle(ref, () => ({ dispatch }), []);
|
||||
React.useEffect(() => {
|
||||
if (videoElementRef.current !== null) {
|
||||
videoRef.current = new StremioVideo({
|
||||
selectVideoImplementation,
|
||||
containerElement: videoElementRef.current
|
||||
});
|
||||
videoRef.current = new StremioVideo({ containerElement: videoElementRef.current });
|
||||
videoRef.current.on('ended', () => {
|
||||
if (typeof onEndedRef.current === 'function') {
|
||||
onEndedRef.current();
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
// Copyright (C) 2017-2020 Smart code 203358507
|
||||
|
||||
const { ChromecastSenderVideo, HTMLVideo, YouTubeVideo, withStreamingServer, withHTMLSubtitles } = require('@stremio/stremio-video');
|
||||
|
||||
const selectVideoImplementation = (args) => {
|
||||
if (!args.stream || typeof args.stream.externalUrl === 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (args.chromecastTransport && args.chromecastTransport.getCastState() === cast.framework.CastState.CONNECTED) {
|
||||
return ChromecastSenderVideo;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
if (typeof args.stream.url === 'string') {
|
||||
return withHTMLSubtitles(HTMLVideo);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
module.exports = selectVideoImplementation;
|
||||
Loading…
Reference in a new issue