mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-18 13:40:32 +00:00
27 lines
861 B
TypeScript
27 lines
861 B
TypeScript
// Example extracted in http://www.schillmania.com/projects/soundmanager2/doc/getstarted/
|
|
const mySoundObject = soundManager.createSound ({
|
|
// optional id, for getSoundById() look-ups etc. If omitted, an id will be generated.
|
|
id: 'mySound',
|
|
url: '/audio/mysoundfile.mp3',
|
|
// optional sound parameters here, see Sound Properties for full list
|
|
volume: 50,
|
|
autoPlay: true,
|
|
whileloading() { console.log(<string> this.id + ' is loading'); }
|
|
});
|
|
|
|
soundManager.setup({
|
|
url: '/path/to/swfs/',
|
|
flashVersion: 9,
|
|
preferFlash: false, // prefer 100% HTML5 mode, where both supported
|
|
onready: () => {
|
|
// console.log('SM2 ready!');
|
|
},
|
|
ontimeout: () => {
|
|
// console.log('SM2 init failed!');
|
|
},
|
|
defaultOptions: {
|
|
// set global default volume for all sound objects
|
|
volume: 33
|
|
}
|
|
});
|