Danno
Danno

Reputation: 26

Create JS WebAudioPlugin doesn't fallback to HTMLAudioPlugin Facebook Browser Android 4.4

I am currently using the CreateJS suite for audio and various purposes and I am getting an error on the Facebook Browser on Android 4.4 It seems that the WebAudioPlugin isn't supported however it doesn't fallback to HTMLAudio as specified in the CreateJS docs:

"This plugin is the second priority plugin installed by default, after the WebAudioPlugin."

This is currently how I'm registering plugins when they break.

createjs.Sound.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin]);

However if I change the order it works.

createjs.Sound.registerPlugins([createjs.HTMLAudioPlugin, createjs.WebAudioPlugin]);

I am not entirely sure what impact this has and I'd like to prioritize WebAudio over HTMLAudio so I'm not sure if there are implications like that for changing the order. Is WebAudio still prioritized if I register the plugins in this order? or if not is there a way to ensure that WebAudio falls back to HTMLAudio?

Upvotes: 1

Views: 104

Answers (1)

Danno
Danno

Reputation: 26

Resolved this by adding my own conditional for Facebook to BrowserDetect as I saw that Createjs doesn't have a check for this in it's isSupported function only standard IOS, Android etc.

BrowserDetect.isFacebookBrowser = (/FBAN/i.test(agent) || /FBAV/i.test(agent) || /FB_IAB/i.test(agent));

By combining this with the Android check you can create a fallback for Facebook on Android.

Upvotes: 0

Related Questions