nulib / avalon

Variations-on-Video Hydra app
Apache License 2.0
3 stars 0 forks source link

AVR: Firefox won't stream some videos through canvas #396

Closed davidschober closed 5 years ago

davidschober commented 6 years ago

Description

avr is having an intermittent problem streaming certain videos in canvas.

To Recreate

mbklein commented 6 years ago

I believe there are two culprits here: Caching and CORS. When the page is loaded from the server, MediaElement and Firefox send the correct Origin header to the streaming server, and the streaming server responds with the correct Access-Control-Allow-Origin header. But when the page is reloaded from cache, The Origin header doesn't get sent, meaning there is no Access-Control-Allow-Origin header in the response, triggering a CORS rejection from the browser. Right-clicking the AVR frame and selecting "Reload Frame" makes it work, but only until the next cached navigation.

The solution might be as simple as adding a random ?req=RANDOM_NUMBER parameter to every link on the search results page, preventing the detail pages from being cached. (Or adding the Cache-Control: no-cache header to all detail pages, which is actually the right way to do that.)

The problem is going to be testing the solution. There's a Canvas docker image I might be able to set up later for local testing, but we don't have a good link between A&RT's staging Canvas and our staging AVR.

davidschober commented 5 years ago

closing. too hard to replicated. THis was a very specific ff version