I've got a problem. I want to load a video in webm format through js, but localhost don't load the video due to CSP
Refused to load media from 'http://localhost:8079/Talking.webm' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'media-src' was not explicitly set, so 'default-src' is used as a fallback.
I tried to add <meta http-equiv="Content-Security-Policy" content="base-uri 'self'; connect-src 'self'; default-src 'self'; font-src 'self'; frame-src 'self'; img-src 'self'; manifest-src 'self'; media-src 'self'; object-src 'none'; script-src 'report-sample' 'self'; style-src 'report-sample' 'self'; worker-src 'none';"> but localhost 4some reason loads default-src 'none' instead of default-src 'self' and ofcourse doesn't find other meta. I would say localhost just ignore this meta tag.
Video is rendered good, because when i start only index.html the video loads correctly. Each script from js file (only one file) is working correctly except video.
I tried to add video through index.html and through js new video tag create if new user joins, but in this way it didn't load any video so video from index.html wasn't loaded too.
Content needs to pass all your policies, and adding another policy in meta (or header) does not relax other policies, it is still blocked by the same policy with "default-src 'none'". You will need to identify the preexisting policy and add a media-src directive that allows your content.