I have successfully implemented a video player using hls.js, and I have some ts files stored in https:/// along with an m3u8 file.
To read the content of the m3u8 file, I used PHP to fetch it and sent the data to JavaScript (res["manifest"] = the content of m3u8), and then passed it into hls.loadSource(), as shown below:
var manifest = res["manifest"];
var blob = new Blob([manifest]);
var hls = new Hls();
var url = URL.createObjectURL(blob);
hls.loadSource(url);
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
video.load();
});
After this, hls began fetching the files listed in the m3u8 document using the following format:
blob:https://<my domain>/<video name>.mp4
However, since the actual files are located at:
https://<my domain>/<video name>.mp4
The URLs starting with "blob:" are created by URL.createObjectURL in the front-end. I now want to configure hls to send requests to video.php, which will then read the ts files and respond with their contents from the server side.
Is there any method to achieve this? (such as modifying the source code or changing settings)