mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
Merge pull request #498 from Stremio/chore/update-core-web-2
Update core
This commit is contained in:
commit
eb682fd8c3
6 changed files with 32 additions and 31 deletions
14
package-lock.json
generated
14
package-lock.json
generated
|
|
@ -12,7 +12,7 @@
|
|||
"@babel/runtime": "7.16.0",
|
||||
"@sentry/browser": "6.13.3",
|
||||
"@stremio/stremio-colors": "5.0.1",
|
||||
"@stremio/stremio-core-web": "0.44.25",
|
||||
"@stremio/stremio-core-web": "0.44.28",
|
||||
"@stremio/stremio-icons": "5.0.0-beta.3",
|
||||
"@stremio/stremio-video": "0.0.25-rc.2",
|
||||
"a-color-picker": "1.2.1",
|
||||
|
|
@ -2704,9 +2704,9 @@
|
|||
"integrity": "sha512-Dt3PYmy1DZ473QNs99KYXVWQPHtpIl37VUY0+gCEvvuCqE1fRrZIJtZ9KbysUKonvO7WwdQDztgcW0iGoc1dEA=="
|
||||
},
|
||||
"node_modules/@stremio/stremio-core-web": {
|
||||
"version": "0.44.25",
|
||||
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.25.tgz",
|
||||
"integrity": "sha512-kW/AAh+c1qnfV5xFbfM+VFFvuRXp4M1pQuUj94O6my2kC39zKkZnFMQRDNbzoodoUQY0fusDM1K7rIw3DmlqEg==",
|
||||
"version": "0.44.28",
|
||||
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.28.tgz",
|
||||
"integrity": "sha512-7c15Nrm/2qctSfQEf/PNMG4m71JmfzPk0+YAu9Z9ye8PRC1fJeNs4c9bPg0PcI95q/fi143t9TDDJ17T9H8jFA==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.16.0"
|
||||
}
|
||||
|
|
@ -16834,9 +16834,9 @@
|
|||
"integrity": "sha512-Dt3PYmy1DZ473QNs99KYXVWQPHtpIl37VUY0+gCEvvuCqE1fRrZIJtZ9KbysUKonvO7WwdQDztgcW0iGoc1dEA=="
|
||||
},
|
||||
"@stremio/stremio-core-web": {
|
||||
"version": "0.44.25",
|
||||
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.25.tgz",
|
||||
"integrity": "sha512-kW/AAh+c1qnfV5xFbfM+VFFvuRXp4M1pQuUj94O6my2kC39zKkZnFMQRDNbzoodoUQY0fusDM1K7rIw3DmlqEg==",
|
||||
"version": "0.44.28",
|
||||
"resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.28.tgz",
|
||||
"integrity": "sha512-7c15Nrm/2qctSfQEf/PNMG4m71JmfzPk0+YAu9Z9ye8PRC1fJeNs4c9bPg0PcI95q/fi143t9TDDJ17T9H8jFA==",
|
||||
"requires": {
|
||||
"@babel/runtime": "7.16.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"@babel/runtime": "7.16.0",
|
||||
"@sentry/browser": "6.13.3",
|
||||
"@stremio/stremio-colors": "5.0.1",
|
||||
"@stremio/stremio-core-web": "0.44.25",
|
||||
"@stremio/stremio-core-web": "0.44.28",
|
||||
"@stremio/stremio-icons": "5.0.0-beta.3",
|
||||
"@stremio/stremio-video": "0.0.25-rc.2",
|
||||
"a-color-picker": "1.2.1",
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ const useMetaDetails = (urlParams) => {
|
|||
extra: []
|
||||
}
|
||||
:
|
||||
null
|
||||
null,
|
||||
guessStream: true,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ const ControlBar = ({
|
|||
statistics,
|
||||
onPlayRequested,
|
||||
onPauseRequested,
|
||||
onNextVideoRequested,
|
||||
onMuteRequested,
|
||||
onUnmuteRequested,
|
||||
onVolumeChangeRequested,
|
||||
|
|
@ -74,14 +75,10 @@ const ControlBar = ({
|
|||
}
|
||||
}, [paused, onPlayRequested, onPauseRequested]);
|
||||
const onNextVideoButtonClick = React.useCallback(() => {
|
||||
if (nextVideo !== null && typeof nextVideo.deepLinks === 'object') {
|
||||
if (nextVideo.deepLinks.player !== null) {
|
||||
window.location.replace(nextVideo.deepLinks.player);
|
||||
} else if (nextVideo.deepLinks.metaDetailsStreams !== null) {
|
||||
window.location.replace(nextVideo.deepLinks.metaDetailsStreams);
|
||||
}
|
||||
if (nextVideo !== null && typeof onNextVideoRequested === 'function') {
|
||||
onNextVideoRequested();
|
||||
}
|
||||
}, [nextVideo]);
|
||||
}, [nextVideo, onNextVideoRequested]);
|
||||
const onMuteButtonClick = React.useCallback(() => {
|
||||
if (muted) {
|
||||
if (typeof onUnmuteRequested === 'function') {
|
||||
|
|
@ -227,6 +224,7 @@ ControlBar.propTypes = {
|
|||
statistics: PropTypes.object,
|
||||
onPlayRequested: PropTypes.func,
|
||||
onPauseRequested: PropTypes.func,
|
||||
onNextVideoRequested: PropTypes.func,
|
||||
onMuteRequested: PropTypes.func,
|
||||
onUnmuteRequested: PropTypes.func,
|
||||
onVolumeChangeRequested: PropTypes.func,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const { default: Icon } = require('@stremio/stremio-icons/react');
|
|||
const { Image, Button, CONSTANTS } = require('stremio/common');
|
||||
const styles = require('./styles');
|
||||
|
||||
const NextVideoPopup = ({ className, metaItem, nextVideo, onDismiss, onPlayNextVideoRequested }) => {
|
||||
const NextVideoPopup = ({ className, metaItem, nextVideo, onDismiss, onNextVideoRequested }) => {
|
||||
const watchNowButtonRef = React.useRef(null);
|
||||
const [animationEnded, setAnimationEnded] = React.useState(false);
|
||||
const videoName = React.useMemo(() => {
|
||||
|
|
@ -37,10 +37,10 @@ const NextVideoPopup = ({ className, metaItem, nextVideo, onDismiss, onPlayNextV
|
|||
}
|
||||
}, [onDismiss]);
|
||||
const onWatchNowButtonClick = React.useCallback(() => {
|
||||
if (typeof onPlayNextVideoRequested === 'function') {
|
||||
onPlayNextVideoRequested();
|
||||
if (typeof onNextVideoRequested === 'function') {
|
||||
onNextVideoRequested();
|
||||
}
|
||||
}, [onPlayNextVideoRequested]);
|
||||
}, [onNextVideoRequested]);
|
||||
React.useLayoutEffect(() => {
|
||||
if (animationEnded === true && watchNowButtonRef.current !== null) {
|
||||
watchNowButtonRef.current.focus();
|
||||
|
|
@ -96,7 +96,7 @@ NextVideoPopup.propTypes = {
|
|||
metaItem: PropTypes.object,
|
||||
nextVideo: PropTypes.object,
|
||||
onDismiss: PropTypes.func,
|
||||
onPlayNextVideoRequested: PropTypes.func
|
||||
onNextVideoRequested: PropTypes.func
|
||||
};
|
||||
|
||||
module.exports = NextVideoPopup;
|
||||
|
|
|
|||
|
|
@ -116,11 +116,11 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
const onEnded = React.useCallback(() => {
|
||||
ended();
|
||||
if (player.nextVideo !== null) {
|
||||
onPlayNextVideoRequested();
|
||||
onNextVideoRequested();
|
||||
} else {
|
||||
window.history.back();
|
||||
}
|
||||
}, [player.nextVideo, onPlayNextVideoRequested]);
|
||||
}, [player.nextVideo, onNextVideoRequested]);
|
||||
const onError = React.useCallback((error) => {
|
||||
console.error('Player', error);
|
||||
if (error.critical) {
|
||||
|
|
@ -197,14 +197,15 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
closeNextVideoPopup();
|
||||
nextVideoPopupDismissed.current = true;
|
||||
}, []);
|
||||
const onPlayNextVideoRequested = React.useCallback(() => {
|
||||
const onNextVideoRequested = React.useCallback(() => {
|
||||
if (player.nextVideo !== null) {
|
||||
window.location.replace(
|
||||
typeof player.nextVideo.deepLinks.player === 'string' ?
|
||||
player.nextVideo.deepLinks.player
|
||||
:
|
||||
player.nextVideo.deepLinks.metaDetailsStreams
|
||||
);
|
||||
const deepLinks = player.nextVideo.deepLinks;
|
||||
if (deepLinks.metaDetailsStreams && deepLinks.player) {
|
||||
window.location.replace(deepLinks.metaDetailsStreams);
|
||||
window.location.href = deepLinks.player;
|
||||
} else {
|
||||
window.location.replace(deepLinks.player ?? deepLinks.metaDetailsStreams);
|
||||
}
|
||||
}
|
||||
}, [player.nextVideo]);
|
||||
const onVideoClick = React.useCallback(() => {
|
||||
|
|
@ -697,6 +698,7 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
statistics={streamingServer.statistics}
|
||||
onPlayRequested={onPlayRequested}
|
||||
onPauseRequested={onPauseRequested}
|
||||
onNextVideoRequested={onNextVideoRequested}
|
||||
onMuteRequested={onMuteRequested}
|
||||
onUnmuteRequested={onUnmuteRequested}
|
||||
onVolumeChangeRequested={onVolumeChangeRequested}
|
||||
|
|
@ -717,7 +719,7 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
metaItem={player.metaItem !== null && player.metaItem.type === 'Ready' ? player.metaItem.content : null}
|
||||
nextVideo={player.nextVideo}
|
||||
onDismiss={onDismissNextVideoPopup}
|
||||
onPlayNextVideoRequested={onPlayNextVideoRequested}
|
||||
onNextVideoRequested={onNextVideoRequested}
|
||||
/>
|
||||
:
|
||||
null
|
||||
|
|
|
|||
Loading…
Reference in a new issue