CreateJS / SoundJS

A Javascript library for working with Audio. It provides a consistent API for loading and playing audio on different browsers and devices. Currently supports WebAudio, HTML5 Audio, Cordova / PhoneGap, and a Flash fallback.
http://createjs.com/
MIT License
4.44k stars 835 forks source link

About WebAudioPlugin Support for Android 4.1.2 #261

Open simongcc opened 7 years ago

simongcc commented 7 years ago

Recently, I am using SoundJS to create a game and need to support Android 4.1.2 However, I found that although Android 4.1.2 Android Browser can play mp3, WebAudioPlugin give it a false mainly because the current checking method is aimed for latest window.AudioContext and the canPlayType is also different in 4.1.2, it is audio/mpeg instead of audio/mp3 nowadays so it does not give a true when checking mp3.

I wonder if it is a good idea to add window.audio in the checking and add mp3: 'mpeg' in the EXTENSION_MAP for a compatibility purpose?

updated notes: I found that only add mp3: 'mpeg' that the HTMLAudioPlugin can support to play mp3 in Android 4.1.2

lannymcnie commented 7 years ago

We can check this out. We might have to reconfigure the type checking to check both the extension AND the map. Currently if we sub in mp3:"mpeg" into the extension map it will use that, and not check for the audio/mp3.

simongcc commented 7 years ago

@lannymcnie Thanks for your reply and looking into it. As a tempoary workaround for myself, I have added also mpeg:"mp3" so that it check both interchangeably.