mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 10: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,
|
ElementRef,
|
||||||
Input,
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
|
OnDestroy,
|
||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
@@ -14,7 +15,7 @@ import * as Hls from 'hls.js';
|
|||||||
templateUrl: './html-video-player.component.html',
|
templateUrl: './html-video-player.component.html',
|
||||||
styleUrls: ['./html-video-player.component.scss'],
|
styleUrls: ['./html-video-player.component.scss'],
|
||||||
})
|
})
|
||||||
export class HtmlVideoPlayerComponent implements OnChanges {
|
export class HtmlVideoPlayerComponent implements OnChanges, OnDestroy {
|
||||||
/** Channel to play */
|
/** Channel to play */
|
||||||
@Input() channel: Channel;
|
@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