feat 关闭src, 切断视频流
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Hls from 'hls.js';
|
||||
import { log } from 'node:console';
|
||||
let hlsInstance: Hls | null = null;
|
||||
// let hlsRetryCount = 0;
|
||||
|
||||
@@ -92,7 +93,9 @@ export const destroyHls = (monitorVideoRef) => {
|
||||
video.removeAttribute('src');
|
||||
// 对某些浏览器,需要调用 load() 来重置 media element
|
||||
if (typeof video.load === 'function') video.load();
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
console.log('Error in destroyHls:', e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user