Commit 655061ba by 潘建波

🐛 ocx提示下载

1 parent 48105429
No preview for this file type
...@@ -27,13 +27,19 @@ export default { ...@@ -27,13 +27,19 @@ export default {
methods: { methods: {
videoPlay: function() { videoPlay: function() {
this.urlFlag = false; this.urlFlag = false;
console.log(this.playurl) console.log(this.playurl);
if (!this.playurl.sip_serv_ip) { if (!this.playurl.sip_serv_ip) {
let url = this.playurl.rtsp_url; let url = this.playurl.rtsp_url;
try { try {
let isLoadingOcx = typeof document.getElementById("VionVideo").GetVersion() === "string" ? true : false; let isLoadingOcx =
typeof document.getElementById("VionVideo").GetVersion() ===
"string"
? true
: false;
if (isLoadingOcx) { if (isLoadingOcx) {
let ocxPlayRes = document.getElementById("VionVideo").StartPlay(url, 0); let ocxPlayRes = document
.getElementById("VionVideo")
.StartPlay(url, 0);
console.log("视频流:", url); console.log("视频流:", url);
if (ocxPlayRes != 0) { if (ocxPlayRes != 0) {
alert("播放失败!"); alert("播放失败!");
...@@ -96,7 +102,7 @@ export default { ...@@ -96,7 +102,7 @@ export default {
this.$message.error("视频控件加载失败请用IE10及以上版本打开!"); this.$message.error("视频控件加载失败请用IE10及以上版本打开!");
} }
}, },
checkIE() { checkIEversion() {
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
if ( if (
/(msie\s|trident.*rv:)([\w.]+)/.test(agent) && /(msie\s|trident.*rv:)([\w.]+)/.test(agent) &&
...@@ -104,11 +110,25 @@ export default { ...@@ -104,11 +110,25 @@ export default {
) { ) {
this.$message.error("IE 版本过低请升级到IE10级以上版本!"); this.$message.error("IE 版本过低请升级到IE10级以上版本!");
} }
},
/**IE
* 检查浏览器
*/
checkIE() {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isIE =
userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
var isIE11 =
userAgent.indexOf("Trident") > -1 && userAgent.indexOf("rv:11.0") > -1;
if (isIE || isEdge || isIE11) {
return true;
} else {
return false;
}
} }
}, },
created() { created() {},
// this.checkIE();
},
computed: { computed: {
...mapState(["ocxstate"]) ...mapState(["ocxstate"])
}, },
...@@ -127,6 +147,17 @@ export default { ...@@ -127,6 +147,17 @@ export default {
} }
} }
}, },
mounted() {
if (this.checkIE()) {
let isLoadingOcx =
typeof document.getElementById("VionVideo").GetVersion() === "string"
? true
: false;
if (!isLoadingOcx) {
this.installOcxInfo();
}
}
},
beforeDestroy: function() { beforeDestroy: function() {
// if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) { // if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) {
// this.videoplayer.pause(); // this.videoplayer.pause();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!