Commit 900f700e authored by 程恺文's avatar 程恺文

视频大小兼容

parent b20f3662
......@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com
* @Date: 2023-04-11 13:40:18
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-04-17 11:05:27
* @LastEditTime: 2023-05-18 15:15:16
* @FilePath: \wisdom-components\packages\base-components\TestVideo\src\demos\dmeo1.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -112,8 +112,10 @@ const Demo1 = (props) => {
<button onClick={startVideo}>开始</button>
<button onClick={testVideo}>测试</button>
<button onClick={destroyVideo}>销毁</button>
<div style={{height:'500px'}}>
<Video {...{ JessibucaObj: JessibucaObj, VideoInfo: VideoParam }} ref={jessibuca} />
</div>
</div>
);
};
......
......@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com
* @Date: 2023-04-11 13:40:18
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-05-18 14:47:06
* @LastEditTime: 2023-05-18 15:11:54
* @FilePath: \wisdom-components\packages\base-components\VmsVideo\src\index.jsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -36,7 +36,7 @@ import style from './index.less';
const Video = (props, ref) => {
const _video = useRef(null);
const Players = useRef(null);
const ref = useRef(null);
const refs = useRef(null);
const [width, setWidth] = useState(0);
const [height, setHeight] = useState(0);
let PlayersA = '';
......@@ -51,9 +51,9 @@ const Video = (props, ref) => {
key: `摄像头`,
};
useLayoutEffect(() => {
console.log(ref.current.offsetWidth,ref.current.offsetHeight,'宽高');
setWidth(ref.current.offsetWidth);
setHeight(ref.current.offsetHeight);
console.log(refs.current.offsetWidth,refs.current.offsetHeight,'宽高');
setWidth(refs.current.offsetWidth);
setHeight(refs.current.offsetHeight);
}, []);
const getToken = async () => {
axios
......@@ -136,7 +136,7 @@ const Video = (props, ref) => {
}, []);
return (
<div ref={ref} className={style.app}>
<div ref={refs} className={style.app}>
{VideoInfo.protocol == '萤石EZOPEN' ? (
<div id={keyID}></div>
) : (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment