javascript - How to tell if soundmanager2 is using html5? - Stack Overflow

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

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)

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)

Share Improve this question asked Apr 24, 2011 at 14:45 codeulikecodeulike 23.1k29 gold badges127 silver badges171 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

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.

set this on soundManager.setup()

soundManager.setup({
    useHTML5Audio: true,
    preferFlash: false
});

There are 2 ways:

  1. Check the version property of your SoundManager2 instance:

    > soundManager.version
    "V2.97a.20131201 (AS3/Flash 9)" // Flash version
    "V2.97a.20131201 (HTML5-only mode)" // HTML5 version
    
  2. Check boolean:

    > soundManager.html5.usingFlash
    

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744401733a4572421.html

相关推荐

  • javascript - How to tell if soundmanager2 is using html5? - Stack Overflow

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

    6天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信