HTML5 Audio not working in ie7 or ie8

后端 未结 3 1924
攒了一身酷
攒了一身酷 2021-01-21 07:55

When testing in IE7/8 my script crashes and I get this error...

SCRIPT438: Object doesn\'t support property or method \'play\'

I\'m

3条回答
  •  误落风尘
    2021-01-21 08:08

    Many older browsers including IE7/8 do not (fully) support HTML 5.

    You can use Modernizr to detect whether the current browser supports audio.

    There are polyfills for many features including audio that can add support for missing features

    https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills

    (scroll down to the Audio section for options)

    The polyfills work on a wide range of supported browsers and browser versions.

提交回复
热议问题