Commit 4b3be60e authored by 李纪文's avatar 李纪文

fix: 修改

parent c9c04c74
...@@ -84,7 +84,7 @@ const Video = (props, ref) => { ...@@ -84,7 +84,7 @@ const Video = (props, ref) => {
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); // console.log(error);
try { try {
PlayersA && PlayersA.stop(); PlayersA && PlayersA.stop();
} catch (e) {} } catch (e) {}
...@@ -104,16 +104,19 @@ const Video = (props, ref) => { ...@@ -104,16 +104,19 @@ const Video = (props, ref) => {
getToken(); getToken();
} }
const resizeObserver = new ResizeObserver((entries) => { const resizeObserver = new ResizeObserver(() => {
PlayersA && PlayersA &&
PlayersA.reSize(refs?.current?.offsetWidth || 952, refs?.current?.offsetHeight || 500); PlayersA.reSize(refs?.current?.offsetWidth || 952, refs?.current?.offsetHeight || 500);
}); });
refs.current && resizeObserver.observe(refs.current);
refs?.current && resizeObserver.observe(refs.current);
return () => { return () => {
try {
try { try {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
resizeObserver.unobserve(refs?.current); refs?.current && resizeObserver.unobserve(refs.current);
} catch (e) {}
try { try {
PlayersA && PlayersA.stop(); PlayersA && PlayersA.stop();
PlayersA && PlayersA.destroy(); PlayersA && PlayersA.destroy();
......
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