fix sound issues in windows

This commit is contained in:
Evgeny Gryaznov 2011-03-02 02:02:28 +01:00
parent 00362f7457
commit f832e38e75
7 changed files with 12 additions and 26 deletions

View File

@ -6,6 +6,7 @@
[+] ability to override notification email for group
[!] various compatibility fixes: button image, captcha, check webimroot variable (installation)
[!] fix speed of history search, fix redirection to groups
[!] fix sound issues in windows
1.6.3
-----

View File

@ -1 +1 @@
var myAgent="";var nk=0;var myRealAgent="";function qk(){var rk=["opera","msie","safari","firefox","netscape","mozilla"];var rj=navigator.userAgent.toLowerCase();for(var i=0;i<rk.length;i++){var sk=rk[i];if(rj.indexOf(sk)!=-1){myAgent=sk;if(!window.RegExp)break;var tk=new RegExp(sk+"[ \/]?([0-9]+(\.[0-9]+)?)");if(tk.exec(rj)!=null){nk=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="Gecko")myAgent="moz";} qk();function getEl(name){return document.getElementById(name);}
var myAgent="";var _j=0;var myRealAgent="";function mk(){var nk=["opera","msie","safari","firefox","netscape","mozilla"];var nj=navigator.userAgent.toLowerCase();for(var i=0;i<nk.length;i++){var qk=nk[i];if(nj.indexOf(qk)!=-1){myAgent=qk;if(!window.RegExp)break;var rk=new RegExp(qk+"[ \/]?([0-9]+(\.[0-9]+)?)");if(rk.exec(nj)!=null){_j=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="Gecko")myAgent="moz";} mk();function getEl(name){return document.getElementById(name);}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
pr.ir({'a#check-nv':function(vh){vh.onclick=function(){ys(wroot+'/sounds/new_user.wav');} ;} ,'a#check-nm':function(vh){vh.onclick=function(){ys(wroot+'/sounds/new_message.wav')} ;} } );
pr.ir({'a#check-nv':function(bh){bh.onclick=function(){vs(wroot+'/sounds/new_user.wav');} ;} ,'a#check-nm':function(bh){bh.onclick=function(){vs(wroot+'/sounds/new_message.wav')} ;} } );

File diff suppressed because one or more lines are too long

27
src/messenger/webim/js/source/common.js Normal file → Executable file
View File

@ -501,29 +501,14 @@ var CommonUtils = {
}
};
function getWavMimeType() {
var mimeType = "application/x-mplayer2"; //default
var agt=navigator.userAgent.toLowerCase();
if (navigator.mimeTypes && agt.indexOf("windows")==-1) {
//non-IE, no-Windows
var plugin=navigator.mimeTypes["audio/mpeg"].enabledPlugin;
if (plugin || agt.indexOf("opera")>=0) mimeType="audio/mpeg";
}//end no-Windows
return mimeType;
}
function playSound(wav_file) {
var player = document.getElementById("player");
if (player) {
player.parentNode.removeChild(player);
}
player = document.body.appendChild(document.createElement("div"));
var agt=navigator.userAgent.toLowerCase();
if(agt.indexOf('safari') == -1 && agt.indexOf('windows') != -1) {
player.innerHTML = '<embed type="'+getWavMimeType()+'" src="'+wav_file+'" loop="0" autostart="1" width="0" height="0">';
} else {
player.innerHTML = '<div style="position: static; width: 0px; height: 0px"><embed type="'+getWavMimeType()+'" src="'+wav_file+'" hidden="true" loop="false" autostart="true"></div>';
var player = document.createElement("div");
var agt = navigator.userAgent.toLowerCase();
if(agt.indexOf('opera') != -1) {
player.style = "position: absolute; left: 0px; top: -200px;";
}
document.body.appendChild(player);
player.innerHTML = '<embed src="'+wav_file+'" hidden="true" autostart="true" loop="false">';
}
function htmlescape(str) {