Commit 655061ba by 潘建波

🐛 ocx提示下载

1 parent 48105429
No preview for this file type
......@@ -27,13 +27,19 @@ export default {
methods: {
videoPlay: function() {
this.urlFlag = false;
console.log(this.playurl)
console.log(this.playurl);
if (!this.playurl.sip_serv_ip) {
let url = this.playurl.rtsp_url;
try {
let isLoadingOcx = typeof document.getElementById("VionVideo").GetVersion() === "string" ? true : false;
let isLoadingOcx =
typeof document.getElementById("VionVideo").GetVersion() ===
"string"
? true
: false;
if (isLoadingOcx) {
let ocxPlayRes = document.getElementById("VionVideo").StartPlay(url, 0);
let ocxPlayRes = document
.getElementById("VionVideo")
.StartPlay(url, 0);
console.log("视频流:", url);
if (ocxPlayRes != 0) {
alert("播放失败!");
......@@ -96,7 +102,7 @@ export default {
this.$message.error("视频控件加载失败请用IE10及以上版本打开!");
}
},
checkIE() {
checkIEversion() {
var agent = navigator.userAgent.toLowerCase();
if (
/(msie\s|trident.*rv:)([\w.]+)/.test(agent) &&
......@@ -104,11 +110,25 @@ export default {
) {
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() {
// this.checkIE();
},
created() {},
computed: {
...mapState(["ocxstate"])
},
......@@ -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() {
// if (this.videoplayer.techName_ == "Flash" && 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!