Improve handling of x-origin duration fetching

This commit is contained in:
Jordan Eldredge 2018-02-28 16:25:07 -08:00
parent c42b33dff7
commit 41862ffde6

View file

@ -232,6 +232,7 @@ export function fetchMediaDuration(url, id) {
// TODO: Does this actually stop downloading the file once it's
// got the duration?
const audio = document.createElement("audio");
audio.crossOrigin = "anonymous";
const durationChange = () => {
const { duration } = audio;
dispatch({ type: SET_MEDIA_DURATION, duration, id });