mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
perf: destroy hls instance after view change
This commit is contained in:
1 file changed
+9
-1
@@ -3,6 +3,7 @@ import {
|
||||
ElementRef,
|
||||
Input,
|
||||
OnChanges,
|
||||
OnDestroy,
|
||||
SimpleChanges,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
@@ -14,7 +15,7 @@ import * as Hls from 'hls.js';
|
||||
templateUrl: './html-video-player.component.html',
|
||||
styleUrls: ['./html-video-player.component.scss'],
|
||||
})
|
||||
export class HtmlVideoPlayerComponent implements OnChanges {
|
||||
export class HtmlVideoPlayerComponent implements OnChanges, OnDestroy {
|
||||
/** Channel to play */
|
||||
@Input() channel: Channel;
|
||||
|
||||
@@ -58,4 +59,11 @@ export class HtmlVideoPlayerComponent implements OnChanges {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy hls instance on component destroy
|
||||
*/
|
||||
ngOnDestroy(): void {
|
||||
this.hls.destroy();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user