This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9284 from samjoch/bug-801895-SoundsUpdateBootSound
Bug 801895 - [Sounds] Update Boot Sound r=alive
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var BootSound = (function() { | ||
|
||
function playBootupSound(delay) { | ||
var bootupSound = new Audio('./resources/sounds/bootup.ogg'); | ||
if (delay === 0) { | ||
bootupSound.play(); | ||
} else { | ||
setTimeout(function timeoutPlay() { | ||
bootupSound.play(); | ||
}, delay || 500); | ||
} | ||
} | ||
|
||
window.addEventListener('ftudone', function ftuDone() { | ||
playBootupSound(); | ||
}); | ||
|
||
window.addEventListener('ftuskip', function skipFTU() { | ||
playBootupSound(1550); | ||
}); | ||
|
||
})(); |
Binary file not shown.