Erratic errors when downloading crossOrigin videos from


Hi, I’m using videos from Twitter posts in a webGL application. Due to cross-origin security issues, it’s necessary to set the video DOM element’s crossOrigin attribute to ‘Anonymous’. I’m finding that sometimes I can download the video data from Twitter without a problem because Twitter is correctly setting the HTTP response header ‘access-control-allow-origin: *’. However, at least as often for the same video I get a CORS exception because that header is not set.

The basic sequence is:

video.crossOrigin = ‘Anonymous’;
video.src = ‘’;

I’ve tried appending a random query string at the end of the URL, to get round any caching issues. That didn’t help.

I also tried a different approach if the first attempt fails: download the video data using Ajax as a blob, and use that. But I then find that sometimes that works, but at least as often it results in an aborted HTTP request.

The problem is shown by this jsfiddle: Apologies that the code in here is a bit hacked together, and mixed between jQuery and basic Javascript. Also, please note that the problem is nondeterministic. So you may find you get the video correctly quite a few times (press Try Again or wait for the every-minute attempt on a setInterval timer) before the problem manifests.

Been tearing my hair out with this for some time, so any advice appreciated.


@timkindberg Thanks for contacting us and a nice write-up. We are aware of this issue and already working on a solution. The root cause is that one of our cdn partners is not respecting CORS headers. So if your request is routed to that cdn partner (which is nondeterministic) then web browser will prevent you from accessing HLS content because CORS headers are not set correctly in the response.


Thanks for getting back to me! This problem is preventing a critical application of mine from working. Do you have any idea when you expect it to be fixed, even at the level of days vs weeks vs months?


@timkindberg Sorry for the trouble. We are trying to get this fixed soon but it is taking longer due to external dependency. Hopefully, this wouldn’t take more than a few weeks.


Thank you! I’d appreciate it if you would post here when it’s fixed. I’m sure I’m not the only one who is interested.


@timkindberg Sure. No problem. I will post updates to this thread.


@timkindberg We have implemented a fix for this issue. We are going to roll it out next 1-2 weeks.


@timkindberg We deployed a fix yesterday. All new videos will work consistently with CORS. Old video files may still fail intermittently due to cdn caches but they will be fixed/updated eventually. Let me know if you have any question.


That’s great, thanks.


This topic was automatically closed after 3 days. New replies are no longer allowed.