mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
fix: destroy hls.js instance on media unmount (#749)
This commit is contained in:
@@ -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'>;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user