properly clean up radio hls instances
This commit is contained in:
parent
9ec60515e8
commit
43ed479de4
2 changed files with 12 additions and 3 deletions
|
@ -58,6 +58,10 @@ const Events = {
|
|||
try {
|
||||
app.mk._services.mediaItemPlayback._currentPlayer.destroy();
|
||||
} catch (e) {}
|
||||
try {
|
||||
this.radiohls.destroy()
|
||||
this.radiohls = null;
|
||||
} catch (_){}
|
||||
try {
|
||||
let searchInt = setInterval(function () {
|
||||
if (document.getElementById("apple-music-player")) {
|
||||
|
|
|
@ -1021,6 +1021,11 @@ const app = new Vue({
|
|||
return;
|
||||
} // EVIL EMPTY OBJECTS BE GONE
|
||||
|
||||
try {
|
||||
this.radiohls.destroy()
|
||||
this.radiohls = null;
|
||||
} catch (_){}
|
||||
|
||||
try {
|
||||
if ((MusicKit.getInstance().nowPlayingItem["type"] ?? "").includes("ideo")) {
|
||||
setTimeout(() => {
|
||||
|
@ -5078,14 +5083,14 @@ const app = new Vue({
|
|||
appData: { serviceName: "Apple Music" },
|
||||
};
|
||||
if (app.radiohls != null && app.radiohls.destroy != null) {
|
||||
app.radiohls.destroy();
|
||||
setTimeout(() => {
|
||||
app.radiohls.destroy();
|
||||
app.radiohls = null;
|
||||
app.radiohls = new CiderHls();
|
||||
app.radiohls.loadSource(e);
|
||||
app.radiohls.attachMedia(app.mk._services.mediaItemPlayback._currentPlayer._targetElement);
|
||||
app.mk._services.mediaItemPlayback._currentPlayer._targetElement.play();
|
||||
}, 500);
|
||||
} else {
|
||||
app.radiohls = null;
|
||||
app.radiohls = new CiderHls();
|
||||
app.radiohls.loadSource(e);
|
||||
app.radiohls.attachMedia(app.mk._services.mediaItemPlayback._currentPlayer._targetElement);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue