|
本帖最后由 每次醒来 于 2012-12-30 14:20 编辑
var kkDapCtrl = null;
function kkGetDapCtrl()
{
if(null == kkDapCtrl) {
try{
if (window.ActiveXObject) {
//if (navigator.userAgent.indexOf('MSIE') != -1) {
kkDapCtrl = new ActiveXObject("DapCtrl.DapCtrl");
} else {
var browserPlugins = navigator.plugins;
for (var bpi=0; bpi<browserPlugins.length; bpi++) {
try {
if (browserPlugins[bpi].name.indexOf('Thunder DapCtrl') != -1) {
var e = document.createElement("object");
e.id = "dapctrl_history";
e.type = "application/x-thunder-dapctrl";
e.width = 0;
e.height = 0;
document.body.appendChild(e);
break;
}
} catch (e) {}
}
kkDapCtrl = document.getElementById('dapctrl_history');
}
} catch(e) {}
}
return kkDapCtrl;
}
function kkis()
{
try {
var dapCtrl = new ActiveXObject("DapCtrl.DapCtrl");
if (typeof(dapCtrl)!="undefined") {
var iType = dapCtrl.Get("IXMPPACKAGETYPE");
ver = dapCtrl.GetThunderVer("KANKAN","INSTALL");
} else {
return false;
}
} catch (e){
return false;
}
var type = dapCtrl.Get("IXMPPACKAGETYPE");
if(type && ver && ver>229 && (type==2401 || type>3000)){
return true;
}
return false;
}
function kkPlay(url, cid, moviename) {
var dapVersion = 0;
var ver = 0;
try {
var dapCtrl = new ActiveXObject("DapCtrl.DapCtrl");
if (typeof(dapCtrl)!="undefined") {
var iType = dapCtrl.Get("IXMPPACKAGETYPE");
ver = dapCtrl.GetThunderVer("KANKAN","INSTALL");
} else {
dapCtrl=null;
}
} catch (e){
dapCtrl=null;
}
var moviename_lower = moviename.toLocaleLowerCase();
if (moviename_lower != moviename) {
url = url.replace(/\&moviename\=[\d\D]*$/g,"&moviename="+moviename_lower);
moviename = moviename_lower;
}
var ext = moviename.substr(moviename.lastIndexOf('.')+1);
var type = dapCtrl.Get("IXMPPACKAGETYPE");
if(type && ver && ver>229 && (type==2401 || type>3000)){
dapCtrl.Put("sXmpArg", '"'+url+'" /cid "'+cid+'" /title "'+moviename+'" /sstartfrom web_xunbo'+' /sopenfrom web_xunbo');
return;
}
}
function start(url){
var dapCtrl=kkGetDapCtrl();
try {
var ver = dapCtrl.GetThunderVer("KANKAN", "INSTALL");
var type = dapCtrl.Get("IXMPPACKAGETYPE");
if(ver && type && ver >= 672 && type >= 2401)
{
dapCtrl.Put("sXmp4Arg", '"'+url+'" /cid "'+cid+'" /title "'+moviename+'" /sstartfrom _web_xunbo /sopenfrom web_xunbo');
} else {
alert('请先更新迅雷看看播放器,然后刷新本页面!');
}
} catch(e) {
alert('请先安装迅雷看看播放器,然后刷新本页面!');
}
}
两段代码不同的地方就72行和84行
上面是我移植下面那段的代码如果不修改红色字部分 迅雷看看 就调用不出来
修改了红色部分 IE 浏览器可以调用迅雷看看,火狐 谷歌等不行
求高手怎么修改才可以实现 火狐 谷歌 IE都可以调用出 迅雷看看
对方的代码 在火狐 谷歌下面是都可以调用出迅雷看看的- var kkDapCtrl = null;
- function kkGetDapCtrl()
- {
- if(null == kkDapCtrl) {
- try{
- if (window.ActiveXObject) {
- //if (navigator.userAgent.indexOf('MSIE') != -1) {
- kkDapCtrl = new ActiveXObject("DapCtrl.DapCtrl");
- } else {
- var browserPlugins = navigator.plugins;
- for (var bpi=0; bpi<browserPlugins.length; bpi++) {
- try {
- if (browserPlugins[bpi].name.indexOf('Thunder DapCtrl') != -1) {
- var e = document.createElement("object");
- e.id = "dapctrl_history";
- e.type = "application/x-thunder-dapctrl";
- e.width = 0;
- e.height = 0;
- document.body.appendChild(e);
- break;
- }
- } catch (e) {}
- }
- kkDapCtrl = document.getElementById('dapctrl_history');
- }
- } catch(e) {}
- }
- return kkDapCtrl;
- }
- function kkis()
- {
- try {
- var dapCtrl = new ActiveXObject("DapCtrl.DapCtrl");
- if (typeof(dapCtrl)!="undefined") {
- var iType = dapCtrl.Get("IXMPPACKAGETYPE");
- ver = dapCtrl.GetThunderVer("KANKAN","INSTALL");
- } else {
- return false;
- }
- } catch (e){
- return false;
- }
- var type = dapCtrl.Get("IXMPPACKAGETYPE");
- if(type && ver && ver>229 && (type==2401 || type>3000)){
- return true;
- }
- return false;
- }
- function kkPlay(url, cid, moviename) {
- var dapVersion = 0;
- var ver = 0;
- try {
- var dapCtrl = new ActiveXObject("DapCtrl.DapCtrl");
- if (typeof(dapCtrl)!="undefined") {
- var iType = dapCtrl.Get("IXMPPACKAGETYPE");
- ver = dapCtrl.GetThunderVer("KANKAN","INSTALL");
- } else {
- dapCtrl=null;
- }
- } catch (e){
- dapCtrl=null;
- }
- var moviename_lower = moviename.toLocaleLowerCase();
- if (moviename_lower != moviename) {
- url = url.replace(/\&moviename\=[\d\D]*$/g,"&moviename="+moviename_lower);
- moviename = moviename_lower;
- }
- var ext = moviename.substr(moviename.lastIndexOf('.')+1);
- var type = dapCtrl.Get("IXMPPACKAGETYPE");
- if(type && ver && ver>229 && (type==2401 || type>3000)){
- dapCtrl.Put("sXmpArg", '"'+url+'"'+" /sname "+'"'+title+'"'+' /sstartfrom web_xunbo'+' /sopenfrom web_xunbo');
- return;
- }
- }
- function start(url){
- var dapCtrl=kkGetDapCtrl();
- try {
- var ver = dapCtrl.GetThunderVer("KANKAN", "INSTALL");
- var type = dapCtrl.Get("IXMPPACKAGETYPE");
- if(ver && type && ver >= 672 && type >= 2401)
- {
- dapCtrl.Put("sXmp4Arg", '"'+url+'"'+' /sstartfrom _web_xunbo /sopenfrom web_xunbo');
- } else {
- alert('请先更新迅雷看看播放器,然后刷新本页面!');
- }
- } catch(e) {
- alert('请先安装迅雷看看播放器,然后刷新本页面!');
- }
- }
复制代码 |
|