-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPC端检测flash是否可用
55 lines (49 loc) · 1.61 KB
/
PC端检测flash是否可用
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* PC端直播间页面common.js
*
* */
if(!window.Lr) {
var Lr = {
errorNotInstallFlash0: '您还没有安装flash播放器,请点击',
errorNotInstallFlash1: '这里',
errorNotInstallFlash2: '安装'
};
}
!(function ($, window, document) {
// 没有Flash插件,增加提示样式
var FlashTip = {
show: function () {
var tip = '<div class="flashtip"><p>' + Lr.errorNotInstallFlash0
+ '<a href="http://www.adobe.com/go/getflash" target="_blank">' + Lr.errorNotInstallFlash1
+ '</a>' + Lr.errorNotInstallFlash2 + '</p></div>';
$("#callbackPlayer, #livePlayer, #drawPanel, #playbackPanel, #playbackPlayer, #swfId").append(tip);
},
checkFlash: function () {
var isIE = (navigator.appVersion.indexOf("MSIE") >= 0);
var hasFlash = true;
if (isIE) {
try {
var objFlash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
} catch (e) {
hasFlash = false;
}
} else {
if (!navigator.plugins["Shockwave Flash"]) {
hasFlash = false;
}
}
return hasFlash;
},
init: function () {
if (!FlashTip.checkFlash()) {
if(typeof defultVideoSize =='function'){
window.defultVideoSize();
}
FlashTip.show();
}
}
};
$(function () {
FlashTip.init();
});
})(jQuery, window, document, undefined);