hls fix progress
This commit is contained in:
parent
6585bcde1b
commit
f92b5ac293
4 changed files with 31054 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
const {app, BrowserWindow, ipcMain} = require("electron")
|
||||
const {app, BrowserWindow, ipcMain, protocol} = require("electron")
|
||||
const {join, resolve} = require("path")
|
||||
const getPort = require("get-port");
|
||||
const express = require("express");
|
||||
|
@ -52,6 +52,18 @@ const CiderBase = {
|
|||
win = new BrowserWindow(options)
|
||||
}
|
||||
|
||||
// intercept "https://js-cdn.music.apple.com/hls.js/2.141.0/hls.js/hls.js" and redirect to local file "./apple-hls.js" instead
|
||||
win.webContents.session.webRequest.onBeforeRequest(
|
||||
{
|
||||
urls: ["https://js-cdn.music.apple.com/hls.js/2.141.0/hls.js/hls.js"]
|
||||
},
|
||||
(details, callback) => {
|
||||
callback({
|
||||
redirectURL: "http://localhost:9000/apple-hls.js"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
let location = "http://localhost:9000/"
|
||||
win.loadURL(location)
|
||||
win.on("closed", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue