Commit 0f6f19da authored by 李纪文's avatar 李纪文

fix: 视频修改

parent 6f91d058
...@@ -75,6 +75,7 @@ const Video = (props, ref) => { ...@@ -75,6 +75,7 @@ const Video = (props, ref) => {
PlayersA.pause = PlayersA.stop; PlayersA.pause = PlayersA.stop;
if (ref) ref.current = PlayersA; if (ref) ref.current = PlayersA;
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
try { try {
...@@ -83,20 +84,7 @@ const Video = (props, ref) => { ...@@ -83,20 +84,7 @@ const Video = (props, ref) => {
}); });
}; };
const CommonPath =
VideoInfo.gateway || window?.globalConfig?.hasGateWay ? 'PandaCore/GateWay/Video/' : ''; // 配置了gateway或者pc端web配置中有gateway
let operateBtns = {
fullscreen: true,
screenshot: true,
play: true,
record: true,
audio: true,
};
useEffect(() => {
if (VideoInfo.protocol != '萤石EZOPEN') { if (VideoInfo.protocol != '萤石EZOPEN') {
// eslint-disable-next-line react-hooks/rules-of-hooks
useImperativeHandle(ref, () => { useImperativeHandle(ref, () => {
// changeVal 就是暴露给父组件的方法, newVal是父组件传递的参数 // changeVal 就是暴露给父组件的方法, newVal是父组件传递的参数
return _video.current.jessibuca; // _video&& _video.current&&_video.current.jessibuca return _video.current.jessibuca; // _video&& _video.current&&_video.current.jessibuca
...@@ -105,6 +93,9 @@ const Video = (props, ref) => { ...@@ -105,6 +93,9 @@ const Video = (props, ref) => {
getToken(); getToken();
} }
const CommonPath =
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 + '/') +
...@@ -112,7 +103,14 @@ const Video = (props, ref) => { ...@@ -112,7 +103,14 @@ const Video = (props, ref) => {
'jessica/' + 'jessica/' +
VideoInfo.id; VideoInfo.id;
// eslint-disable-next-line react-hooks/exhaustive-deps let operateBtns = {
fullscreen: true,
screenshot: true,
play: true,
record: true,
audio: true,
};
_VideoInfo = { ..._VideoInfo, ...VideoInfo }; _VideoInfo = { ..._VideoInfo, ...VideoInfo };
if (JessibucaObj && JessibucaObj.operateBtns) { if (JessibucaObj && JessibucaObj.operateBtns) {
...@@ -122,6 +120,7 @@ const Video = (props, ref) => { ...@@ -122,6 +120,7 @@ const Video = (props, ref) => {
}; };
} }
useEffect(() => {
return () => { return () => {
try { try {
PlayersA && PlayersA.stop(); PlayersA && PlayersA.stop();
......
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