types/soundmanager2 - added audioFormats SoundManager Top-Level property (#39048)

* types/soundmanager2 - added audioFormats SoundManager Top-Level property

* Update types/soundmanager2/index.d.ts - added related to SoundManagerAudioFormat

Co-Authored-By: Andrew Branch <andrewbranch@users.noreply.github.com>
This commit is contained in:
Jakub Simon
2019-12-02 16:08:42 +01:00
committed by Andrew Branch
parent ff69d22d5d
commit 7134cfbbb4
2 changed files with 12 additions and 0 deletions

View File

@@ -54,6 +54,12 @@ declare namespace soundmanager {
duration?: number | null;
}
interface SoundManagerAudioFormat {
type: string[];
required: boolean;
related?: string[];
}
interface SoundManagerProps {
/**
* The directory where SM2 can find the flash movies (soundmanager2.swf,
@@ -141,6 +147,7 @@ declare namespace soundmanager {
togglePause(id: string): SMSound;
unload(id: string): SMSound;
unmute(id?: string): SMSound;
audioFormats?: { [audioFormat: string]: SoundManagerAudioFormat };
}
class SMSound {

View File

@@ -24,3 +24,8 @@ soundManager.setup({
volume: 33
}
});
// set mp3 format not required
if (soundManager.audioFormats) {
soundManager.audioFormats.mp3.required = false;
}