1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-10-22 11:43:33 +00:00

defer player dispose to avoid dom conflicts (#8255)

Co-authored-by: zhouwenxuan <aries@Mac.local>
This commit is contained in:
Aries
2025-09-25 13:37:31 +08:00
committed by GitHub
parent 53ee92514d
commit bc0f94d0cf

View File

@@ -32,9 +32,15 @@ class VideoPlayer extends React.Component {
// destroy player on unmount
componentWillUnmount() {
setTimeout(() => {
try {
if (this.player) {
this.player.dispose();
}
} catch (e) {
//
}
}, 0);
}
// wrap the player in a div with a `data-vjs-player` attribute