Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell if soundmanager2 is using html5?

soundmanager2 will use html5 audio instead of flash if various properties are set and it thinks conditions are Ok.

Once soundmanager2 has decided, is there a property on the SoundManager object that will tell me whether it went for html5 or flash?

(I know it mentions it in the debug log but I'm looking for a property I could query)

like image 896
codeulike Avatar asked Feb 03 '26 13:02

codeulike


2 Answers

I don't think it's documented but the SMSound object has an isHTML5 property that you can check to see if a given sound is using HTML5 Audio.

The SoundManager object also has an html5 property that contains information about what audio formats are supported by the current browser.

like image 118
jimr Avatar answered Feb 06 '26 03:02

jimr


set this on soundManager.setup()

soundManager.setup({
    useHTML5Audio: true,
    preferFlash: false
});
like image 33
vlycser Avatar answered Feb 06 '26 02:02

vlycser