Jwplayer encounters CORS error on iOS device

58 Views Asked by At

I use jwplayer to play video on another site of mine.

  <div id="myVideoPlayer"></div>

  <script>
    // Configure and initialize JWPlayer
    var player = jwplayer("myVideoPlayer").setup({
      file: "https://anothersite.com/videos/test.mp4",
      autostart: false,
      controls: true, 
    });
  </script>

This works well on desktops and android phones, but on iPhones, there will be an error "Error loading media: File could not be played". On my macbook's safari, I select user agent to be iOS and see that there is a CORS error in the console with "status code 206", as the screenshot below shows:

enter image description here My Jwplayer's version is 7.3.5.

I've tried adding the following directives to my destination server's .htaccess, but it doesn't help:

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods: "GET, POST, OPTIONS, PUT, DELETE"
Header set Access-Control-Allow-Headers: "Content-Type"

Anyone knows how to fix this?

0

There are 0 best solutions below