1

So I recently posted this question: CLICK HERE

And I have come to the conclusion, that I just don't have the time to make this work for Firefox. It would be nice, but I have other projects that I need to work on. So I have decided to just perform a simple functionality check on this, so that it will still play in Firefox, but not attempt to load the visualizer, which is causing the entire player to seize up and not play at all.

But I'm not sure at all with functionality to check for? The Web API works when it's just the Web API, and the Custom Controls work, when it's just the Custom Controls, so what exactly would I check for, so that

if(functionality not supported){
    //Don't load Visualizer at all();
}

My Original jFiddle is here: http://jsfiddle.net/murphy1976/yqqf7uL1/1/

Community
  • 1
  • 1
Murphy1976
  • 1,415
  • 8
  • 40
  • 88

1 Answers1

2

Well, you're trying to work around a bug here. So if you want real feature detection, you'd need to write a function that tries to do what you want and see if it works or not. Because you're dealing with CORS stuff and making requests, that means it'll be an asynchronous test - which might be tough depending on how your app is set up.

Another option, which would be sub-optimal but also very easy, is to just do something like /firefox/i.test( navigator.userAgent ).

Kevin Ennis
  • 14,226
  • 2
  • 43
  • 44
  • I was hoping not to have to resort on userAgent, since when Firefox gets it's bug fixed, which is a legitimate documented issue, I would have to go back into the code and remove the userAgent. – Murphy1976 Dec 15 '14 at 18:59
  • Yeah, I hear you. You could definitely run a quick test on a file that you know has CORS headers and see if it works – you'd just need to work around the fact that your feature test is asynchronous. – Kevin Ennis Dec 16 '14 at 00:12