update stremio-video

This commit is contained in:
nklhrstv 2022-05-10 17:16:16 +03:00
parent fbb88c759f
commit b808e3909f
4 changed files with 14 additions and 10 deletions

6
package-lock.json generated
View file

@ -1856,9 +1856,9 @@
"integrity": "sha512-knlcBibqJW2mbEgid6YEeQN9FPkIGAEtozYWqzKWeHd2DPY2nl8kYX2pMQpa2Db/RVSqbVstu/gdey5TtSgGYw=="
},
"@stremio/stremio-video": {
"version": "0.0.17-rc.7",
"resolved": "https://registry.npmjs.org/@stremio/stremio-video/-/stremio-video-0.0.17-rc.7.tgz",
"integrity": "sha512-FTn503YkyeIP5VoyNCu2nlepCV5E5BmaoH9l1yz1COsuvy9Yb7mMlNOlVA4/96fczPGcvuK+o1Stv0xxP0QBMg==",
"version": "0.0.17-rc.8",
"resolved": "https://registry.npmjs.org/@stremio/stremio-video/-/stremio-video-0.0.17-rc.8.tgz",
"integrity": "sha512-rDohMYGyto2RI6RRU4KHEpfW90C7C/gM/XK0uBynC47tp/bKgcQcxHMaBNyF5K2c9nOzNcsTD58/V1uIHk8DlA==",
"requires": {
"color": "4.2.3",
"deep-freeze": "0.0.1",

View file

@ -17,7 +17,7 @@
"@stremio/stremio-colors": "4.0.1",
"@stremio/stremio-core-web": "0.34.0",
"@stremio/stremio-icons": "3.0.5",
"@stremio/stremio-video": "0.0.17-rc.7",
"@stremio/stremio-video": "0.0.17-rc.8",
"a-color-picker": "1.2.1",
"buffer": "6.0.3",
"classnames": "2.3.1",

View file

@ -69,9 +69,9 @@ const Player = ({ urlParams, queryParams }) => {
}
);
const videoRef = React.useRef(null);
const dispatch = React.useCallback((args) => {
const dispatch = React.useCallback((action, options) => {
if (videoRef.current !== null) {
videoRef.current.dispatch(args);
videoRef.current.dispatch(action, options);
}
}, []);
const onImplementationChanged = React.useCallback((manifest) => {
@ -259,9 +259,10 @@ const Player = ({ urlParams, queryParams }) => {
streamingServer.selected.transportUrl
:
null,
chromecastTransport: chromecast.active ? chromecast.transport : null,
seriesInfo: player.seriesInfo
}
}, {
chromecastTransport: chromecast.active ? chromecast.transport : null,
});
}
}, [streamingServer.baseUrl, player.selected, player.metaItem, forceTranscoding, maxAudioChannels, casting]);

View file

@ -17,10 +17,13 @@ const Video = React.forwardRef(({ className, ...props }, ref) => {
const onImplementationChangedRef = useLiveRef(props.onImplementationChanged);
const videoElementRef = React.useRef(null);
const videoRef = React.useRef(null);
const dispatch = React.useCallback((action) => {
const dispatch = React.useCallback((action, options = {}) => {
if (videoRef.current !== null) {
try {
videoRef.current.dispatch(action);
videoRef.current.dispatch(action, {
...options,
containerElement: videoElementRef.current
});
} catch (error) {
console.error('Video', error);
}
@ -29,7 +32,7 @@ const Video = React.forwardRef(({ className, ...props }, ref) => {
React.useImperativeHandle(ref, () => ({ dispatch }), []);
React.useEffect(() => {
if (videoElementRef.current !== null) {
videoRef.current = new StremioVideo({ containerElement: videoElementRef.current });
videoRef.current = new StremioVideo();
videoRef.current.on('ended', () => {
if (typeof onEndedRef.current === 'function') {
onEndedRef.current();