videojs / videojs-contrib-hls

HLS library for video.js
http://videojs.github.io/videojs-contrib-hls/
Other
2.84k stars 792 forks source link

Segments not get loaded when m3u8 file loaded from browser disk cache #1344

Closed Nagaraj-Prabhu closed 6 years ago

Nagaraj-Prabhu commented 6 years ago

video.js version 6.6.3 videojs-contrib-hls.js version 5.12.2

I am loading VOD files through video.js with above versions. Some videos will give problem while playing, even though index(master m3u8 file) file get loaded. It will throw an error in the console. When I checked in the 'Network' tab in chrome developer tools. It will show index.m3u8 loaded from disk cache and other files where not get requested(variant m3u8 and corresponding ts files).

This issue mainly found in Google Chrome and Microsoft Edge browser. Console Error output is: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '__.com' is therefore not allowed access.

Please help me in this regard.

gesinger commented 6 years ago

Hey @Nagaraj-Prabhu , it looks like you are encountering a CORS issue. Please have a look at https://github.com/videojs/videojs-contrib-hls#hosting-considerations . Thanks.

Nagaraj-Prabhu commented 6 years ago

HI @gesinger, as the video.js is not getting variant m3u8 and ts segments, it is throwing that error I checked it in Network tab in Google Chrome. This error comes when a video master file(index.m3u8) loaded from disk cache and it will not request other files from the server.

gkatsev commented 6 years ago

It's possible the index.m3u8 loaded just fine and has CORS headers bu the media playlists and segments don't have CORS setup.

Nagaraj-Prabhu commented 6 years ago

Hi @gkatsev, I tried with 'disable cache' and the video played fine so I am thinking the problem may because of disk caching of files.