Commit 7835d5af authored by 程恺文's avatar 程恺文

修改

parent 6d05797f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com * @Author: 634665781 634665781@qq.com
* @Date: 2023-04-11 13:40:18 * @Date: 2023-04-11 13:40:18
* @LastEditors: 634665781 634665781@qq.com * @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-05-22 10:06:05 * @LastEditTime: 2023-05-24 16:51:22
* @FilePath: \wisdom-components\packages\base-components\TestVideo\src\demos\dmeo1.tsx * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -86,6 +86,11 @@ const Demo1 = (props) => { ...@@ -86,6 +86,11 @@ const Demo1 = (props) => {
// ****** // ******
// 其他事件需查看在线文档 // 其他事件需查看在线文档
// ****** // ******
return ()=>{
console.log('销毁。。。。。。。。。。。。。。。。。。。。。。。。。');
stopVideo()
}
}, []); }, []);
const stopVideo = () => { const stopVideo = () => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com * @Author: 634665781 634665781@qq.com
* @Date: 2023-04-11 13:40:18 * @Date: 2023-04-11 13:40:18
* @LastEditors: 634665781 634665781@qq.com * @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-05-23 14:54:42 * @LastEditTime: 2023-05-24 16:34:00
* @FilePath: \wisdom-components\packages\base-components\VmsVideo\src\index.jsx * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -101,42 +101,43 @@ const Video = (props, ref) => { ...@@ -101,42 +101,43 @@ const Video = (props, ref) => {
// 通过事件对象获取浏览器窗口的高度 // 通过事件对象获取浏览器窗口的高度
setWidth(refs.current.offsetWidth); setWidth(refs.current.offsetWidth);
setHeight(refs.current.offsetHeight); setHeight(refs.current.offsetHeight);
// PlayersA?.stop?.() // PlayersA?.stop?.()
console.log(PlayersA,'视频对象'); console.log(PlayersA, '视频对象11111111111111111111111111111111111111111111111');
PlayersA.stop() PlayersA.stop();
getToken() getToken();
}; };
useEffect(() => { useEffect(() => {
if (VideoInfo.protocol != '萤石EZOPEN') {
useImperativeHandle(ref, () => {
// changeVal 就是暴露给父组件的方法, newVal是父组件传递的参数
return _video.current.jessibuca; // _video&& _video.current&&_video.current.jessibuca
});
} else {
getToken();
}
// 页面刚加载完成后获取浏览器窗口的大小 // 页面刚加载完成后获取浏览器窗口的大小
setWidth(refs.current.offsetWidth); setWidth(refs.current.offsetWidth);
setHeight(refs.current.offsetHeight); setHeight(refs.current.offsetHeight);
// 页面变化时获取浏览器窗口的大小 // 页面变化时获取浏览器窗口的大小
window.addEventListener('resize', resizeUpdate); window.addEventListener('resize', resizeUpdate);
return () => { return () => {
// 组件销毁时移除监听事件 // 组件销毁时移除监听事件
window.removeEventListener('resize', resizeUpdate); window.removeEventListener('resize', resizeUpdate);
} };
}, []) }, []);
if (VideoInfo.protocol != '萤石EZOPEN') {
useImperativeHandle(ref, () => {
// changeVal 就是暴露给父组件的方法, newVal是父组件传递的参数
return _video.current.jessibuca; // _video&& _video.current&&_video.current.jessibuca
});
} else {
getToken();
}
const CommonPath = const CommonPath =
( VideoInfo.gateway || window?.globalConfig?.hasGateWay )? 'PandaCore/GateWay/Video/' : ''; // 配置了gateway或者pc端web配置中有gateway VideoInfo.gateway || window?.globalConfig?.hasGateWay ? 'PandaCore/GateWay/Video/' : ''; // 配置了gateway或者pc端web配置中有gateway
VideoInfo.url = VideoInfo.useFullUrl VideoInfo.url = VideoInfo.useFullUrl
? VideoInfo.fullUrl ? VideoInfo.fullUrl
: (VideoInfo.pandavmsHost || ('ws://' + location.host + '/')) + : (VideoInfo.pandavmsHost || 'ws://' + location.host + '/') +
(CommonPath) + CommonPath +
'jessica/' + 'jessica/' +
VideoInfo.id; VideoInfo.id;
......
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