-- experiment with forcefully closing the session on dispose

This commit is contained in:
infinite-persistence 2021-12-10 08:57:26 +08:00 committed by Thomas Zarebczan
parent 42a8f3180d
commit 561ed0ea23

View file

@ -267,6 +267,10 @@ export default React.memo<Props>(function VideoJs(props: Props) {
const player = playerRef.current; const player = playerRef.current;
if (player) { if (player) {
try {
window.cast.framework.CastContext.getInstance().getCurrentSession().endSession(false);
} catch {}
player.dispose(); player.dispose();
window.player = undefined; window.player = undefined;
} }