update video playbackrate
This commit is contained in:
parent
97409d61a9
commit
c767a7fe2e
@ -11,11 +11,23 @@ import QualityCheckLeft from "../../components/Modules/QualityCheck/LeftSide";
|
|||||||
import FireCheckRight from "../../components/Modules/FireCheck/RightSide";
|
import FireCheckRight from "../../components/Modules/FireCheck/RightSide";
|
||||||
import QualityCheckRight from "../../components/Modules/QualityCheck/RightSide";
|
import QualityCheckRight from "../../components/Modules/QualityCheck/RightSide";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
import { useEffect, useRef } from "react";
|
||||||
|
|
||||||
export default function Home({ active }) {
|
export default function Home({ active }) {
|
||||||
|
const videoUp = useRef(null);
|
||||||
|
const videoDown = useRef(null);
|
||||||
|
|
||||||
const ctx = useSelector((state) => state.fireInfo);
|
const ctx = useSelector((state) => state.fireInfo);
|
||||||
const fireDir = ctx.fireDirection || null;
|
const fireDir = ctx.fireDirection || null;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (fireDir == "东火") {
|
||||||
|
videoUp.current.playbackRate = 0.3;
|
||||||
|
} else {
|
||||||
|
videoDown.current.playbackRate = 0.3;
|
||||||
|
}
|
||||||
|
}, [fireDir]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="Main">
|
<div className="Main">
|
||||||
{active != "窑炉总览" && <div className="bgDitu"></div>}
|
{active != "窑炉总览" && <div className="bgDitu"></div>}
|
||||||
@ -53,6 +65,7 @@ export default function Home({ active }) {
|
|||||||
<div key="v3d" className="V3DBorder" style={{ zIndex: -2 }}>
|
<div key="v3d" className="V3DBorder" style={{ zIndex: -2 }}>
|
||||||
{fireDir && fireDir == "东火" && (
|
{fireDir && fireDir == "东火" && (
|
||||||
<video
|
<video
|
||||||
|
ref={videoUp}
|
||||||
src="/video/east_fire.webm"
|
src="/video/east_fire.webm"
|
||||||
muted
|
muted
|
||||||
autoPlay
|
autoPlay
|
||||||
@ -70,6 +83,7 @@ export default function Home({ active }) {
|
|||||||
|
|
||||||
{fireDir && fireDir == "西火" && (
|
{fireDir && fireDir == "西火" && (
|
||||||
<video
|
<video
|
||||||
|
ref={videoDown}
|
||||||
src="/video/west_fire.webm"
|
src="/video/west_fire.webm"
|
||||||
muted
|
muted
|
||||||
autoPlay
|
autoPlay
|
||||||
|
Loading…
Reference in New Issue
Block a user