1

Here's what I'm doing: (1) Create a video element; (2) create an AudioContext and a MediaElementSourceNode on the video element; (3) connect the MediaElementSourceNode to the destination node; (4) play the video.

It always works in Chrome. In Firefox, it only shows the first frame of the video.

Code:

var video = document.createElement('video');
video.setAttribute('crossorigin', 'anonymous');
video.src = 'https://dl.dropboxusercontent.com/s/tozkw68tccsp39a/BrianNalumonWindmill360p.mp4'

var audioContext = new AudioContext();

var source = audioContext.createMediaElementSource(video);
source.connect(audioContext.destination);

document.body.appendChild(video);
video.play();

Interestingly, it works in Firefox if the video is on the same server as the web page. So I suspect some kind of cross-origin issue. But if they're on different servers, whether or not I request a CORS header (that's the video.setAttribute line in the above code), it fails in Firefox (and works in Chrome).

It would totally make sense to me if it worked with the CORS header and failed without. The fact that it fails either way seems like a Firefox bug to me; I'm just not quite confident enough to file a bug report (yet).

Anyone have another explanation, or a fix?

aldel
  • 6,489
  • 1
  • 27
  • 32
  • Hmm, I think this may be bug [https://bugzilla.mozilla.org/show_bug.cgi?id=937718](https://bugzilla.mozilla.org/show_bug.cgi?id=937718), which would make this a duplicate of [this question](http://stackoverflow.com/questions/20180550/firefox-webaudio-createmediaelementsource-not-working). – aldel Nov 25 '14 at 17:29

1 Answers1

2

Firefox Web Audio API developer here, this is a bug on our side, as you guessed.

Also, please do no hesitate to file bugs. Worst case it gets resolved as invalid or duplicate (in which case it's useful to weight priorities).

padenot
  • 1,515
  • 8
  • 11
  • Added bug, thoroughly explained, and exemplified: https://bugzilla.mozilla.org/show_bug.cgi?id=1111382 – JeanLescure Dec 15 '14 at 07:13
  • 1
    Just a message to tell everybody that the fix will be available in tomorrow's Firefox Nightly. The fix will be present in Firefox 37, that will be released the 2015-04-07. – padenot Jan 05 '15 at 14:04