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