Mixed content with http source problem
I would like to use player on https website, but content should be loaded from unsecure http server (live stream). Is there any option (eg. Content Secure Policy) to load content? I'm receiving mixed-content errors.
yes you should be able to workaround this using CSP header useful links here : https://developers.google.com/web/fundamentals/security/prevent-mixed-content/fixing-mixed-content#handle-mixed-content-at-scale
Ok,thank you for info. But I'm not sure where I have to add additional CSP header. Should it be added in hls.js config? Could you give me some example?
AFAIU, CSP cannot workaround mixed content errors when an HTTPS web page tries to fetch media data from an HTTP server. I would love to learn otherwise, though. :-)
I still hope that it can work. It is working twitch.tv. There is warn in console but content is not blocked.
Twitch's Flash streams work with HTTPS because the Flash Player doesn't block mixed content. Twitch's HTML5 streams (using HLS and MSE) don't work for me with HTTPS. A motivated individual could work around the mixed content blocking by tunneling an HTTPS web page's XHR requests through a Flash SWF to fetch HTTP media data. :) HLS.js has configuration hooks for writing custom loaders that could do fancy things like this.
- HTTPS Flash: https://player.twitch.tv/?channel=monstercat
- HTTPS HTML5: https://player.twitch.tv/?channel=monstercat&html5
Ok, so there is no way to configure it with CSP header or another trick? I prefer not to use flash as old technology.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Use Proxy to load HTTP video source https://github.com/netnr/proxy
You can add "https://netnr-proxy.cloudno.de/" before your video URL.
e.g.
https://netnr-proxy.cloudno.de/<YOUR_VIDEO_URL>
if your video URL is "http://www.yourvideourl.com/stream.m3u8"
https://netnr-proxy.cloudno.de/http://www.yourvideourl.com/stream.m3u8