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

fix: 修改

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