|
32 | 32 | * auto : Supports auto-play audio - if Don‘t support it, On a touch detecting background music canvas, and then replay
|
33 | 33 | * replay : The first music will fail, must be replay after touchstart
|
34 | 34 | * emptied : Whether to use the emptied event to replace load callback
|
| 35 | + * delay : delay created the context object - only webAudio |
35 | 36 | *
|
36 | 37 | * May be modifications for a few browser version
|
37 | 38 | */
|
|
48 | 49 | // ANDROID //
|
49 | 50 | supportTable[sys.BROWSER_TYPE_ANDROID] = {multichannel: false, webAudio: false, auto: false};
|
50 | 51 | supportTable[sys.BROWSER_TYPE_CHROME] = {multichannel: true , webAudio: true , auto: false};
|
51 |
| - supportTable[sys.BROWSER_TYPE_FIREFOX] = {multichannel: true , webAudio: true , auto: true }; |
| 52 | + supportTable[sys.BROWSER_TYPE_FIREFOX] = {multichannel: true , webAudio: true , auto: true , delay: true}; |
52 | 53 | supportTable[sys.BROWSER_TYPE_UC] = {multichannel: true , webAudio: false, auto: false};
|
53 | 54 | supportTable[sys.BROWSER_TYPE_QQ] = {multichannel: false, webAudio: false, auto: true };
|
54 | 55 | supportTable[sys.BROWSER_TYPE_OUPENG] = {multichannel: false, webAudio: false, auto: false, replay: true , emptied: true };
|
@@ -476,6 +477,8 @@ cc.Audio = cc.Class.extend({
|
476 | 477 | try{
|
477 | 478 | if(SWA){
|
478 | 479 | var context = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)();
|
| 480 | + if(polyfill.delay) |
| 481 | + setTimeout(function(){ context = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)(); }, 0); |
479 | 482 | }
|
480 | 483 | }catch(error){
|
481 | 484 | SWA = false;
|
|
0 commit comments