优化Video
parent
86c826f1a1
commit
acb52f66a0
|
|
@ -1,4 +1,4 @@
|
||||||
import { Modal } from "antd";
|
import { Button, Modal } from "antd";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { getFileUrl } from "../../utils";
|
import { getFileUrl } from "../../utils";
|
||||||
import AliPlayer from "./AliPlayer";
|
import AliPlayer from "./AliPlayer";
|
||||||
|
|
@ -21,7 +21,6 @@ const Video = ({
|
||||||
title = "视频",
|
title = "视频",
|
||||||
visible: externalVisible = false,
|
visible: externalVisible = false,
|
||||||
onCancel,
|
onCancel,
|
||||||
...restProps
|
|
||||||
}) => {
|
}) => {
|
||||||
const [internalVisible, setInternalVisible] = useState(false);
|
const [internalVisible, setInternalVisible] = useState(false);
|
||||||
const playerRef = useRef(null);
|
const playerRef = useRef(null);
|
||||||
|
|
@ -68,15 +67,15 @@ const Video = ({
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
open={visible}
|
open={visible}
|
||||||
|
width={800}
|
||||||
title={title}
|
title={title}
|
||||||
footer={[
|
footer={[
|
||||||
<button key="cancel" onClick={() => setVisible(false)}>
|
<Button key="cancel" onClick={() => setVisible(false)}>
|
||||||
取消
|
取消
|
||||||
</button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
onCancel={() => setVisible(false)}
|
onCancel={() => setVisible(false)}
|
||||||
{...restProps}
|
|
||||||
>
|
>
|
||||||
{playerElement}
|
{playerElement}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue