]>
jfr.im git - irc/quakenet/qwebirc.git/blob - js/sound.js
1 qwebirc
.sound
.domReady
= false;
2 window
.addEvent("domready", function() {
3 qwebirc
.sound
.domReady
= true;
6 qwebirc
.sound
.SoundPlayer
= new Class({
8 initialize: function() {
9 this.loadingSWF
= false;
10 this.loadedSWF
= false;
13 if(qwebirc
.sound
.domReady
) {
14 this.loadSoundManager();
16 window
.addEvent("domready", function() {
17 this.loadSoundManager();
21 loadSoundManager: function() {
24 this.loadingSWF
= true;
25 if(eval("typeof soundManager") != "undefined") {
26 this.loadedSWF
= true;
27 this.fireEvent("ready");
31 qwebirc
.util
.importJS("/js/soundmanager2.js", "soundManager", function() {
32 soundManager
.url
= "/sound/";
34 /* Fixes Firefox z-index Flash bug */
35 if(Browser
.Engine
.gecko
)
36 soundManager
.useHighPerformance
= false;
38 soundManager
.debugMode
= false;
39 soundManager
.useConsole
= false;
40 soundManager
.onload = function() {
41 this.loadedSWF
= true;
42 this.fireEvent("ready");
44 soundManager
.beginDelayedInit();
47 createSound: function(name
, src
) {
48 soundManager
.createSound(name
, src
);
50 playSound: function(name
) {
51 soundManager
.play(name
);
54 if(!this.beepLoaded
) {
55 this.createSound("beep", "/sound/beep.mp3");
56 this.beepLoaded
= true;
58 this.playSound("beep");