/* Jappix - An open social platform These are the audio JS scripts for Jappix ------------------------------------------------- License: AGPL Author: Valérian Saliou Last revision: 04/05/12 */ // Plays the given sound ID function soundPlay(num) { try { // Not supported! if((BrowserDetect.browser == 'Explorer') && (BrowserDetect.version < 9)) return false; // If the sounds are enabled if(getDB('options', 'sounds') == '1') { // If the audio elements aren't yet in the DOM if(!exists('#audio')) { $('body').append( '
' + '' + '' + '' + '
' ); } // We play the target sound var playThis = document.getElementById('audio').getElementsByTagName('audio')[num]; // Fixes Chrome audio bug when Get API serves expired files (for development work purposes) if(window.chrome && isDeveloper()) playThis.load(); playThis.play(); } } catch(e) {} finally { return false; } }