Sometimes, we need to remove sound from the problem devices like galaxy s3, sharp, xperia Z , and hide audio button on them.
I found a solution for that.
First, we need to add an events and global variable to a project:
[attachment=0:3a3k6fdi][/attachment:3a3k6fdi]
Then, we need to export the game and add a code to the index.html
// Create new runtime using the c2canvas
cr_createRuntime("c2canvas");
//put a code right here in your index.html
});
//CODE
var ua = navigator.userAgent.toLowerCase();
var isSthree = ((/gt-i9300|gt-i9305|gt-i9301|sgh-n064|sgh-n035|sch-j021|sgh-t999l/i).test(ua));
var isSharp = ((/SHL24|SHL23|SHL22|SHL25|SHL21/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
var isXperia = ((/D6603|D6616|D6633|D6643|D6653|L55t|L55u|D6708/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
var isXperiaZ = ((/C6602|C6603|C6606|C6616|SO-02E/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
var isIE10 = /MSIE 10/i.test(navigator.userAgent);
var isTest = false;
// var isTest = false;
delete sessionStorage.rm_disablesound;
if (typeof (Storage) !== "undefined")
{
if(isSthree || isSharp || isIE10 || isTest || isXperia || isXperiaZ)
{
sessionStorage.rm_disablesound = 1;
}
}
[/code:3a3k6fdi]
That code was written not by me and i can't explain it throughly.