mirror of
https://github.com/Qortal/q-tube.git
synced 2025-02-12 02:05:52 +00:00
Fixed bug causing video to play after Saving to Disk.
Fixed lint errors in FileElement.tsx
This commit is contained in:
parent
db490ec6b1
commit
78a6bcfdde
42
package-lock.json
generated
42
package-lock.json
generated
@ -13,6 +13,7 @@
|
|||||||
"@mui/icons-material": "^5.11.11",
|
"@mui/icons-material": "^5.11.11",
|
||||||
"@mui/lab": "^5.0.0-alpha.163",
|
"@mui/lab": "^5.0.0-alpha.163",
|
||||||
"@mui/material": "^5.11.13",
|
"@mui/material": "^5.11.13",
|
||||||
|
"@preact/signals-react": "^2.2.0",
|
||||||
"@reduxjs/toolkit": "^1.9.3",
|
"@reduxjs/toolkit": "^1.9.3",
|
||||||
"compressorjs": "^1.2.1",
|
"compressorjs": "^1.2.1",
|
||||||
"dompurify": "^3.0.6",
|
"dompurify": "^3.0.6",
|
||||||
@ -1463,6 +1464,33 @@
|
|||||||
"url": "https://opencollective.com/popperjs"
|
"url": "https://opencollective.com/popperjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@preact/signals-core": {
|
||||||
|
"version": "1.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@preact/signals-core/-/signals-core-1.8.0.tgz",
|
||||||
|
"integrity": "sha512-OBvUsRZqNmjzCZXWLxkZfhcgT+Fk8DDcT/8vD6a1xhDemodyy87UJRJfASMuSD8FaAIeGgGm85ydXhm7lr4fyA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/preact"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@preact/signals-react": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@preact/signals-react/-/signals-react-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-EPYlhXqqcOUxz2gTQGt4rtK6X7Jr04517DcJVZ4I5a7Gxy39haK24uFeVWtiU/tnEReRFcxpQN6poYra1jf68A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@preact/signals-core": "^1.7.0",
|
||||||
|
"use-sync-external-store": "^1.2.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/preact"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": "^16.14.0 || 17.x || 18.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@reduxjs/toolkit": {
|
"node_modules/@reduxjs/toolkit": {
|
||||||
"version": "1.9.5",
|
"version": "1.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.5.tgz",
|
||||||
@ -5528,6 +5556,20 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
|
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
|
||||||
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="
|
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="
|
||||||
},
|
},
|
||||||
|
"@preact/signals-core": {
|
||||||
|
"version": "1.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@preact/signals-core/-/signals-core-1.8.0.tgz",
|
||||||
|
"integrity": "sha512-OBvUsRZqNmjzCZXWLxkZfhcgT+Fk8DDcT/8vD6a1xhDemodyy87UJRJfASMuSD8FaAIeGgGm85ydXhm7lr4fyA=="
|
||||||
|
},
|
||||||
|
"@preact/signals-react": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@preact/signals-react/-/signals-react-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-EPYlhXqqcOUxz2gTQGt4rtK6X7Jr04517DcJVZ4I5a7Gxy39haK24uFeVWtiU/tnEReRFcxpQN6poYra1jf68A==",
|
||||||
|
"requires": {
|
||||||
|
"@preact/signals-core": "^1.7.0",
|
||||||
|
"use-sync-external-store": "^1.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@reduxjs/toolkit": {
|
"@reduxjs/toolkit": {
|
||||||
"version": "1.9.5",
|
"version": "1.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.5.tgz",
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
"@mui/icons-material": "^5.11.11",
|
"@mui/icons-material": "^5.11.11",
|
||||||
"@mui/lab": "^5.0.0-alpha.163",
|
"@mui/lab": "^5.0.0-alpha.163",
|
||||||
"@mui/material": "^5.11.13",
|
"@mui/material": "^5.11.13",
|
||||||
|
"@preact/signals-react": "^2.2.0",
|
||||||
"@reduxjs/toolkit": "^1.9.3",
|
"@reduxjs/toolkit": "^1.9.3",
|
||||||
"compressorjs": "^1.2.1",
|
"compressorjs": "^1.2.1",
|
||||||
"dompurify": "^3.0.6",
|
"dompurify": "^3.0.6",
|
||||||
|
@ -2,7 +2,6 @@ import { Box, CircularProgress, Typography } from "@mui/material";
|
|||||||
import { setVideoPlaying } from "../../../../state/features/globalSlice.ts";
|
import { setVideoPlaying } from "../../../../state/features/globalSlice.ts";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { PlayArrow } from "@mui/icons-material";
|
import { PlayArrow } from "@mui/icons-material";
|
||||||
import { playing } from "../VideoPlayer-State.ts";
|
|
||||||
|
|
||||||
export interface LoadingVideoProps {
|
export interface LoadingVideoProps {
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
@ -103,7 +102,7 @@ export const LoadingVideo = ({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (from === "create") return;
|
if (from === "create") return;
|
||||||
dispatch(setVideoPlaying(null));
|
dispatch(setVideoPlaying(null));
|
||||||
playing.value = true; // makes autoplay after video loaded work properly
|
|
||||||
togglePlay();
|
togglePlay();
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
|
@ -147,8 +147,8 @@ export const useVideoControlsState = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const togglePlay = async () => {
|
const togglePlay = async () => {
|
||||||
|
// console.log("in toggleplay playing is: ", playing.value);
|
||||||
if (!videoRef.current) return;
|
if (!videoRef.current) return;
|
||||||
|
|
||||||
if (!src || resourceStatus?.status !== "READY") {
|
if (!src || resourceStatus?.status !== "READY") {
|
||||||
const el = document.getElementById("videoWrapper");
|
const el = document.getElementById("videoWrapper");
|
||||||
if (el) {
|
if (el) {
|
||||||
@ -159,11 +159,12 @@ export const useVideoControlsState = (
|
|||||||
});
|
});
|
||||||
getSrc();
|
getSrc();
|
||||||
}
|
}
|
||||||
|
|
||||||
startPlay.value = true;
|
startPlay.value = true;
|
||||||
|
|
||||||
|
const pause = playing.value;
|
||||||
playing.value = !playing.value;
|
playing.value = !playing.value;
|
||||||
|
|
||||||
if (playing.value) videoRef.current.pause();
|
if (pause) videoRef.current.pause();
|
||||||
else await videoRef.current.play();
|
else await videoRef.current.play();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -178,7 +179,6 @@ export const useVideoControlsState = (
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (autoPlay && identifier) {
|
if (autoPlay && identifier) {
|
||||||
console.log("autoplay useEffect");
|
|
||||||
togglePlay();
|
togglePlay();
|
||||||
}
|
}
|
||||||
}, [autoPlay, identifier]);
|
}, [autoPlay, identifier]);
|
||||||
|
@ -76,7 +76,7 @@ export const VideoControls = ({
|
|||||||
}}
|
}}
|
||||||
onClick={() => togglePlay()}
|
onClick={() => togglePlay()}
|
||||||
>
|
>
|
||||||
{!playing.value ? <Pause /> : <PlayArrow />}
|
{playing.value ? <Pause /> : <PlayArrow />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
sx={{
|
sx={{
|
||||||
@ -150,7 +150,7 @@ export const VideoControls = ({
|
|||||||
}}
|
}}
|
||||||
onClick={() => togglePlay()}
|
onClick={() => togglePlay()}
|
||||||
>
|
>
|
||||||
{!playing.value ? <Pause /> : <PlayArrow />}
|
{playing.value ? <Pause /> : <PlayArrow />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
sx={{
|
sx={{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user