mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 17:15:48 +00:00
Compare commits
5 commits
b784ff9db5
...
85196abe76
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85196abe76 | ||
|
|
31a5cc6f1a | ||
|
|
a14a1b8798 | ||
|
|
d130a0de0a | ||
|
|
ef98490be6 |
5 changed files with 48 additions and 8 deletions
|
|
@ -55,7 +55,7 @@ importers:
|
|||
version: 24.2.3(typescript@5.9.2)
|
||||
langs:
|
||||
specifier: github:Stremio/nodejs-langs
|
||||
version: https://codeload.github.com/Stremio/nodejs-langs/tar.gz/24daad4e78c324fcc88d6673df3cd75348b2efdf
|
||||
version: https://codeload.github.com/Stremio/nodejs-langs/tar.gz/e5a3af7d2dd556592cbfe7cf879c1064ed0081a1
|
||||
lodash.debounce:
|
||||
specifier: 4.0.8
|
||||
version: 4.0.8
|
||||
|
|
@ -3051,8 +3051,8 @@ packages:
|
|||
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
langs@https://codeload.github.com/Stremio/nodejs-langs/tar.gz/24daad4e78c324fcc88d6673df3cd75348b2efdf:
|
||||
resolution: {tarball: https://codeload.github.com/Stremio/nodejs-langs/tar.gz/24daad4e78c324fcc88d6673df3cd75348b2efdf}
|
||||
langs@https://codeload.github.com/Stremio/nodejs-langs/tar.gz/e5a3af7d2dd556592cbfe7cf879c1064ed0081a1:
|
||||
resolution: {tarball: https://codeload.github.com/Stremio/nodejs-langs/tar.gz/e5a3af7d2dd556592cbfe7cf879c1064ed0081a1}
|
||||
version: 2.0.0
|
||||
|
||||
launch-editor@2.11.1:
|
||||
|
|
@ -8295,7 +8295,7 @@ snapshots:
|
|||
|
||||
kleur@3.0.3: {}
|
||||
|
||||
langs@https://codeload.github.com/Stremio/nodejs-langs/tar.gz/24daad4e78c324fcc88d6673df3cd75348b2efdf: {}
|
||||
langs@https://codeload.github.com/Stremio/nodejs-langs/tar.gz/e5a3af7d2dd556592cbfe7cf879c1064ed0081a1: {}
|
||||
|
||||
launch-editor@2.11.1:
|
||||
dependencies:
|
||||
|
|
|
|||
|
|
@ -99,6 +99,10 @@
|
|||
"name": "한국어",
|
||||
"codes": ["ko-KR", "kor"]
|
||||
},
|
||||
{
|
||||
"name": "Lietuvių",
|
||||
"codes": ["lt-LT", "ltu"]
|
||||
},
|
||||
{
|
||||
"name": "македонски јазик",
|
||||
"codes": ["mk-MK", "mkd"]
|
||||
|
|
@ -107,6 +111,10 @@
|
|||
"name": "ဗမာစာ",
|
||||
"codes": ["my-BM", "mya"]
|
||||
},
|
||||
{
|
||||
"name": "नेपाली",
|
||||
"codes": ["ne-NP", "nep"]
|
||||
},
|
||||
{
|
||||
"name": "Norsk bokmål",
|
||||
"codes": ["nb-NO", "nob"]
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ const all = langs.all().map((lang) => ({
|
|||
label: lang.local,
|
||||
alpha2: lang['1'],
|
||||
alpha3: [lang['2'], lang['2B'], lang['2T'], lang['3']],
|
||||
locale: lang['locale'],
|
||||
ietf: lang['ietf'],
|
||||
}));
|
||||
|
||||
const find = (code: string) => {
|
||||
return all.find(({ alpha2, alpha3, locale }) => [alpha2, ...alpha3, locale].includes(code));
|
||||
return all.find(({ alpha2, alpha3, ietf }) => [alpha2, ...alpha3, ietf].includes(code));
|
||||
};
|
||||
|
||||
const label = (code: string) => {
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
const toast = useToast();
|
||||
|
||||
const [seeking, setSeeking] = React.useState(false);
|
||||
|
||||
const isMlbHeld = React.useRef(false);
|
||||
const MlbHoldTimerRef = React.useRef(null);
|
||||
const currPlaybackSpeed = React.useRef(null);
|
||||
|
||||
const [casting, setCasting] = React.useState(() => {
|
||||
return services.chromecast.active && services.chromecast.transport.getCastState() === cast.framework.CastState.CONNECTED;
|
||||
|
|
@ -331,6 +335,31 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
closeSideDrawer();
|
||||
}, []);
|
||||
|
||||
const onVideoMouseDown = React.useCallback((event) => {
|
||||
if (event.button !== 0) return;
|
||||
MlbHoldTimerRef.current = setTimeout(() => {
|
||||
currPlaybackSpeed.current = video.state.playbackSpeed;
|
||||
isMlbHeld.current = true;
|
||||
video.setProp('playbackSpeed',2.00);
|
||||
}, 500);
|
||||
}, [video]);
|
||||
|
||||
const onVideoMouseUp = React.useCallback((event) => {
|
||||
clearTimeout(MlbHoldTimerRef.current);
|
||||
if (isMlbHeld.current){
|
||||
video.setProp('playbackSpeed',currPlaybackSpeed.current);
|
||||
isMlbHeld.current = false;
|
||||
}
|
||||
}, [video]);
|
||||
|
||||
const onVideoMouseLeave = React.useCallback((event) => {
|
||||
clearTimeout(MlbHoldTimerRef.current);
|
||||
if (isMlbHeld.current) {
|
||||
video.setProp('playbackSpeed',currPlaybackSpeed.current);
|
||||
isMlbHeld.current = false;
|
||||
}
|
||||
}, [video]);
|
||||
|
||||
const onContainerMouseMove = React.useCallback((event) => {
|
||||
setImmersed(false);
|
||||
if (!event.nativeEvent.immersePrevented) {
|
||||
|
|
@ -789,6 +818,9 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
className={styles['layer']}
|
||||
onClick={onVideoClick}
|
||||
onDoubleClick={onVideoDoubleClick}
|
||||
onMouseDown={onVideoMouseDown}
|
||||
onMouseUp={onVideoMouseUp}
|
||||
onMouseLeave={onVideoMouseLeave}
|
||||
/>
|
||||
{
|
||||
!video.state.loaded ?
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ const PropTypes = require('prop-types');
|
|||
const classnames = require('classnames');
|
||||
const styles = require('./styles');
|
||||
|
||||
const Video = React.forwardRef(({ className, onClick, onDoubleClick }, ref) => {
|
||||
const Video = React.forwardRef(({ className, onClick, onDoubleClick, onMouseUp, onMouseDown, onMouseLeave }, ref) => {
|
||||
return (
|
||||
<div className={classnames(className, styles['video-container'])} onClick={onClick} onDoubleClick={onDoubleClick}>
|
||||
<div className={classnames(className, styles['video-container'])} onClick={onClick} onDoubleClick={onDoubleClick} onMouseUp={onMouseUp} onMouseDown={onMouseDown} onMouseLeave={onMouseLeave}>
|
||||
<div ref={ref} className={styles['video']} />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue