fix: destroy hls.js instance on media unmount (#749)

This commit is contained in:
Wesley Luyten
2026-03-06 11:30:48 +11:00
committed by GitHub
parent 5fc52aa969
commit c4e8bbd3a2
4 changed files with 21 additions and 7 deletions
+5 -4
View File
@@ -53,10 +53,11 @@ export function MediaDelegateMixin<Base extends Constructor<any>, Delegate exten
}
return DelegateMedia as unknown as Constructor<
InstanceType<Base> & {
attach(target: EventTarget): void;
detach(): void;
}
InstanceType<Base> &
InstanceType<Delegate> & {
attach(target: EventTarget): void;
detach(): void;
}
> &
Omit<Base, 'prototype'>;
}
+4
View File
@@ -28,6 +28,10 @@ export class HlsMediaDelegateBase implements MediaDelegate {
this.#engine.detachMedia();
}
destroy(): void {
this.#engine.destroy();
}
set src(src: string) {
this.#engine.loadSource(src);
}