JWPlayer 7 error "cannot load m3u8 crossdomain access denied" chrome only win 10

Paul picture Paul · Jun 6, 2017 · Viewed 10.9k times · Source

On pc windows 10 Firefox and Edge loads ok. In chrome only! "cannot load m3u8: crossdomain access denied"

JWPlayer HTML code

<script> var playerInstance = jwplayer('Player'); playerInstance.setup({ primary: 'flash', file: 'http://example/playlist.m3u8', image: "//example/example.png", title: "example" }); </script>

Crossdomain.xml

<cross-domain-policy>
  <allow-access-from domain="*" secure="false"/>
  <allow-http-request-headers-from secure="false" headers="*" domain="*"/>
</cross-domain-policy>

Answer

Francesco picture Francesco · Jun 7, 2017

You need to set the CORS header of stream files ..../playlist.m3u8 and it's needed when the player works in HTML5 Mode (on new releases of Chrome the Flash plugin has blocked by default)

Access-Control-Allow-Origin:*

It's a mechanism similar to Flash.

You can test your CORS HLS streams on hls.js demo page: http://video-dev.github.io/hls.js/demo/

about CORS: https://enable-cors.org/