improved radio support
This commit is contained in:
parent
62a95f1ea1
commit
d4e23a3e75
1 changed files with 30 additions and 1 deletions
|
@ -20,6 +20,7 @@ const app = new Vue({
|
||||||
pluginMenuEntries: [],
|
pluginMenuEntries: [],
|
||||||
lz: ipcRenderer.sendSync("get-i18n", "en_US"),
|
lz: ipcRenderer.sendSync("get-i18n", "en_US"),
|
||||||
lzListing: ipcRenderer.sendSync("get-i18n-listing"),
|
lzListing: ipcRenderer.sendSync("get-i18n-listing"),
|
||||||
|
radiohls: null,
|
||||||
search: {
|
search: {
|
||||||
term: "",
|
term: "",
|
||||||
cursor: -1,
|
cursor: -1,
|
||||||
|
@ -5056,7 +5057,35 @@ const app = new Vue({
|
||||||
});
|
});
|
||||||
// Load first source
|
// Load first source
|
||||||
let src = sources[0];
|
let src = sources[0];
|
||||||
app.mk._services.mediaItemPlayback._currentPlayer._playAssetURL(src, false);
|
if (src.includes("http")){
|
||||||
|
app.mk._services.mediaItemPlayback._currentPlayer._playAssetURL(src, false);} else {
|
||||||
|
if (Hls.isSupported()) {
|
||||||
|
let d = "WIDEVINE_SOFTWARE"
|
||||||
|
let h = {
|
||||||
|
initDataTypes: ["cenc", "keyids"],
|
||||||
|
distinctiveIdentifier: "optional",
|
||||||
|
persistentState: "required"
|
||||||
|
}
|
||||||
|
let p = {
|
||||||
|
platformInfo: { requiresCDMAttachOnStart: !0, maxSecurityLevel: d, keySystemConfig: h },
|
||||||
|
appData: { serviceName: "Apple Music" }
|
||||||
|
}
|
||||||
|
if (app.radiohls != null && app.radiohls.destroy != null){
|
||||||
|
app.radiohls.destroy()
|
||||||
|
setTimeout(()=>{
|
||||||
|
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 = new CiderHls();
|
||||||
|
app.radiohls.loadSource(e);
|
||||||
|
app.radiohls.attachMedia(app.mk._services.mediaItemPlayback._currentPlayer._targetElement);
|
||||||
|
app.mk._services.mediaItemPlayback._currentPlayer._targetElement.play()}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue