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,9 +84,25 @@ const Video = (props, ref) => { ...@@ -83,9 +84,25 @@ const Video = (props, ref) => {
}); });
}; };
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.fullUrl
: (VideoInfo.pandavmsHost || 'ws://' + location.host + '/') +
(VideoInfo.gateway ? CommonPath : '') +
'jessica/' +
VideoInfo.id;
let operateBtns = { let operateBtns = {
fullscreen: true, fullscreen: true,
screenshot: true, screenshot: true,
...@@ -94,34 +111,16 @@ const Video = (props, ref) => { ...@@ -94,34 +111,16 @@ const Video = (props, ref) => {
audio: true, audio: true,
}; };
useEffect(() => { _VideoInfo = { ..._VideoInfo, ...VideoInfo };
if (VideoInfo.protocol != '萤石EZOPEN') {
// eslint-disable-next-line react-hooks/rules-of-hooks if (JessibucaObj && JessibucaObj.operateBtns) {
useImperativeHandle(ref, () => { JessibucaObj.operateBtns = {
// changeVal 就是暴露给父组件的方法, newVal是父组件传递的参数 ...operateBtns,
return _video.current.jessibuca; // _video&& _video.current&&_video.current.jessibuca ...JessibucaObj.operateBtns,
}); };
} else { }
getToken();
}
VideoInfo.url = VideoInfo.useFullUrl
? VideoInfo.fullUrl
: (VideoInfo.pandavmsHost || 'ws://' + location.host + '/') +
(VideoInfo.gateway ? CommonPath : '') +
'jessica/' +
VideoInfo.id;
// eslint-disable-next-line react-hooks/exhaustive-deps
_VideoInfo = { ..._VideoInfo, ...VideoInfo };
if (JessibucaObj && JessibucaObj.operateBtns) {
JessibucaObj.operateBtns = {
...operateBtns,
...JessibucaObj.operateBtns,
};
}
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