Skip to content

audioEngine not playing in Firefox, using minified/compiled lib #2709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cocos2d/audio/CCAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* auto : Supports auto-play audio - if Don‘t support it, On a touch detecting background music canvas, and then replay
* replay : The first music will fail, must be replay after touchstart
* emptied : Whether to use the emptied event to replace load callback
* delay : delay created the context object - only webAudio
*
* May be modifications for a few browser version
*/
Expand All @@ -48,7 +49,7 @@
// ANDROID //
supportTable[sys.BROWSER_TYPE_ANDROID] = {multichannel: false, webAudio: false, auto: false};
supportTable[sys.BROWSER_TYPE_CHROME] = {multichannel: true , webAudio: true , auto: false};
supportTable[sys.BROWSER_TYPE_FIREFOX] = {multichannel: true , webAudio: true , auto: true };
supportTable[sys.BROWSER_TYPE_FIREFOX] = {multichannel: true , webAudio: true , auto: true , delay: true};
supportTable[sys.BROWSER_TYPE_UC] = {multichannel: true , webAudio: false, auto: false};
supportTable[sys.BROWSER_TYPE_QQ] = {multichannel: false, webAudio: false, auto: true };
supportTable[sys.BROWSER_TYPE_OUPENG] = {multichannel: false, webAudio: false, auto: false, replay: true , emptied: true };
Expand Down Expand Up @@ -476,6 +477,8 @@ cc.Audio = cc.Class.extend({
try{
if(SWA){
var context = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)();
if(polyfill.delay)
setTimeout(function(){ context = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)(); }, 0);
}
}catch(error){
SWA = false;
Expand Down