function AudioPerform() {
            var ua = navigator.userAgent.toLowerCase();
            var audiopath = "$!{TempletPath}images/ring.wav";
            if (ua.match(/msie ([\d.]+)/)) {
                jQuery('#alert_sound').html('<object class>);
            }
            else if (ua.match(/firefox\/([\d.]+)/)) {
                //            jQuery('#alert_sound').html('<embed src="' + audiopath + '" type="audio/wav" hidden="true" loop="false" mastersound></embed>');
                jQuery('#alert_sound').html('<audio autoplay="autoplay"><source src="' + audiopath + '" type="audio/wav"/><source src="$!{TempletPath}images/ring.wav" type="audio/mpeg"/></audio>');
            }
            else if (ua.match(/chrome\/([\d.]+)/)) {
                jQuery('#alert_sound').html('<audio src="' + audiopath + '" type="audio/wav" autoplay=”autoplay” hidden="true"></audio>');
            }
            else if (ua.match(/opera.([\d.]+)/)) {
                jQuery('#alert_sound').html('<embed src="' + audiopath + '" hidden="true" loop="false"><noembed><bgsounds src=' + audiopath + '></noembed>');
            }
            else if (ua.match(/version\/([\d.]+).*safari/)) {
                jQuery('#alert_sound').html('<audio src="' + audiopath + '" type="audio/wav" autoplay=”autoplay” hidden="true"></audio>');
            }
            else {
                jQuery('#alert_sound').html('<embed src="' + audiopath + '" type="audio/wav" hidden="true" loop="false" mastersound></embed>');
            }
        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案