HLS (HTTP Live Streaming), m3u8 Url 403 issue, works on extension but not when running locally

27 Views Asked by At

I have an issue with playing a m3u8 file that works on HLS extension and their live demo here

https://hlsjs.video-dev.org/demo/?src=https%3A%5C%2F%5C%2Fgovbw.vid109d224.site%5C%2F_v2-oanz%5C%2F12a3c523f9105800ed8c394685aeeb0bc72eaf5c1cbdf7e9084d7baea93ece832257df1a4b6125fcfa38c35da05dee86aad28d46d73fc4e9d4e5a23a5035a3876fc651f40c16ef0a16c4f1ec38157c5131358a7d405f788989c2e90cc3a72ccd2e18b90a0b71b7%5C%2Fh%5C%2Flist%3B15a38634f803584ba8926411d7bee906856cab0654b5bd.m3u8%23.mp4&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==

and the extension you can install on chrome or firefox, but with this simple code i can play most files just fine, but that one i can't play it, my i want to know, why it's working on the extension and live demo but when i run it on my code?

` enter image description here

var video = document.getElementById('video'); var videoSrc = 'https://devstreaming- cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8'; // // First check for native browser HLS support // if (Hls.isSupported()) { var hlsConfig = { debug: true, xhrSetup: function (xhr, url) { // Set CORS headers on the XHR object }, }; var hls = new Hls(hlsConfig); hls.loadSource(videoSrc); hls.attachMedia(video); hls.on(Hls.Events.MEDIA_ATTACHED, function () { video.muted = true; video.play(); }); }

`

the error attached in the picture, i know it seems like CORS issue, but on the extension and the live demo above the file works, please help, i been stuck at this issue.

tried sending with or without credentials, when i debugged the live demo, they don't send credentials, i installed multiple hls versions and still no luck

0

There are 0 best solutions below