diff --git a/index.js b/index.js index 601d830e..1a8a4bab 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,8 @@ const configDefaults = { "animated_artwork_qualityLevel": 1, "bg_artwork_rotation": false, "hw_acceleration": "default", // default, webgpu, disabled - "window_transparency": "disabled" + "window_transparency": "disabled", + "videoRes": 720 }, "lyrics": { "enable_mxm": false, diff --git a/src/renderer/apple-hls.js b/src/renderer/apple-hls.js index e4936dda..04c84e2c 100644 --- a/src/renderer/apple-hls.js +++ b/src/renderer/apple-hls.js @@ -23260,9 +23260,36 @@ } if (null != (l = "string" != typeof (h = g.pathwayID) ? im("invalid steering manifest PATHWAY-PRIORITY list item data type") : /^[\w\-\.]+$/.test(h) ? void 0 : im("steering manifest contains invalid pathway ID: " + h))) break; - if (g.hdcpLevel === "NONE"){ - n.push(g)} + let cpc = g.allowedCPCMap ? JSON.stringify(g.allowedCPCMap) : "null"; + if (!cpc.includes("WIDEVINE_HARDWARE") && !g.url.includes('trickPlay')) + n.push(g) } + + + + try{ + // console.log(n, window.screen.width) + let ok = (n.map( function(item){return{height : item.height, content: item}})); + let screenHeight = (app.cfg.visual.videoRes ?? window.screen.height) ; + ok.sort(function (a, b) { + return a.height - b.height; + }); + for (var i = 0; i < ok.length; i++){ + if (ok[i].height > screenHeight){ + if (i == 0){n.splice(0,n.length);n.push(ok[i].content)} + else{n.splice(0,n.length);n.push(ok[i-1].content)} + console.log('selected' , n[0].height) + break; + + } + + } + if (n.length > 1){ + n.splice(0,n.length - 1); + } + // console.log(n) + // console.log(ok) + } catch (e){ console.log(e)} return { variantMediaOptions: n, contentSteeringOption: u,