Compare commits
3 Commits
74ba466141
...
dd0e01a114
Author | SHA1 | Date | |
---|---|---|---|
|
dd0e01a114 | ||
|
9c0da9915c | ||
|
26837559a5 |
@ -49,7 +49,7 @@
|
|||||||
"pubsub-js": "^1.9.4",
|
"pubsub-js": "^1.9.4",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-countup": "^6.5.3",
|
"react-countup": "^6.5.3",
|
||||||
"react-dom": "18.2.0",
|
"react-dom": "^19.1.1",
|
||||||
"react-i18next": "^14.1.0",
|
"react-i18next": "^14.1.0",
|
||||||
"react-icons": "^5.2.1",
|
"react-icons": "^5.2.1",
|
||||||
"react-markdown": "8.0.0",
|
"react-markdown": "8.0.0",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { useEffect, useMemo, useRef, useState } from "react"
|
import React, { useEffect, useMemo, useRef, useState } from "react"
|
||||||
import iodVideo from "@/public/video.mp4"
|
import iodVideo from "@/public/video.mp4"
|
||||||
import { useOptionLayoutContext } from "@/components/Layouts/Layout.tsx"
|
import { useOptionLayoutContext } from "@/components/Layouts/Layout.tsx"
|
||||||
|
import { createPortal } from "react-dom"
|
||||||
import {
|
import {
|
||||||
ExpandOutlined,
|
ExpandOutlined,
|
||||||
PauseCircleOutlined,
|
PauseCircleOutlined,
|
||||||
@ -185,7 +186,6 @@ const VideoPlayer = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
video.addEventListener("loadedmetadata", handleLoadedMetadata)
|
video.addEventListener("loadedmetadata", handleLoadedMetadata)
|
||||||
video.addEventListener("timeupdate", handleTimeUpdate)
|
video.addEventListener("timeupdate", handleTimeUpdate)
|
||||||
video.addEventListener("waiting", handleWaiting)
|
video.addEventListener("waiting", handleWaiting)
|
||||||
@ -326,7 +326,7 @@ const VideoPlayer = () => {
|
|||||||
onMouseLeave={handleMouseLeave}>
|
onMouseLeave={handleMouseLeave}>
|
||||||
<video
|
<video
|
||||||
ref={videoRef}
|
ref={videoRef}
|
||||||
className="w-full h-full bg-black"
|
className="w-full h-full bg-black [&::-webkit-media-controls]:hidden [&::-webkit-media-controls-start-playback-button]:hidden"
|
||||||
onClick={togglePlayPause}
|
onClick={togglePlayPause}
|
||||||
playsInline
|
playsInline
|
||||||
preload="auto">
|
preload="auto">
|
||||||
@ -351,8 +351,9 @@ const VideoPlayer = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 控制栏 - 使用与原始HTML相同的类名和行为 */}
|
{/* 控制栏 - 使用与原始HTML相同的类名和行为 */}
|
||||||
|
{createPortal(
|
||||||
<div
|
<div
|
||||||
className={`absolute left-0 w-full bg-gradient-to-t from-black to-transparent p-4 transition-all duration-300 ease-in-out flex flex-col gap-2.5 ${showControls ? "bottom-0" : "-bottom-40"}`}>
|
className={`fixed left-0 w-full bg-gradient-to-t from-black to-transparent p-4 transition-all duration-300 ease-in-out flex flex-col gap-2.5 z-50 ${showControls ? "bottom-0" : "-bottom-40"}`}>
|
||||||
<div
|
<div
|
||||||
className="flex items-center justify-end gap-2 cursor-pointer"
|
className="flex items-center justify-end gap-2 cursor-pointer"
|
||||||
onClick={handleEnded}>
|
onClick={handleEnded}>
|
||||||
@ -408,7 +409,9 @@ const VideoPlayer = () => {
|
|||||||
<ExpandOutlined className="text-2xl" />
|
<ExpandOutlined className="text-2xl" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>,
|
||||||
|
document.body
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user