From c6ddf29b050d6ebcc61d5bc8c4835e26c189fb2a Mon Sep 17 00:00:00 2001
From: panjianbo <13651030816@163.com>
Date: Thu, 13 Feb 2020 10:24:23 +0800
Subject: [PATCH] 提交视屏播放

---
 src/views/public/mapvideo2.vue  | 55 +++++++++++++++++++++++++++++++++++++++----------------
 src/views/trafficShow/index.vue | 27 ++++++++++++---------------
 2 files changed, 51 insertions(+), 31 deletions(-)

diff --git a/src/views/public/mapvideo2.vue b/src/views/public/mapvideo2.vue
index 4fafcb3..371f86e 100644
--- a/src/views/public/mapvideo2.vue
+++ b/src/views/public/mapvideo2.vue
@@ -2,9 +2,21 @@
   <div class="item">
     <div class="player">
       <div class="ocx-box">
-        <object id="VionVideo" classid="clsid:96DFBBAF-4220-4978-9681-4ABA534A7718"
-          width="98%" height="850" style="margin-left:.9%">
-        </object>
+        <!-- <object id="VionVideo" classid="clsid:96DFBBAF-4220-4978-9681-4ABA534A7718"
+          width="98%" height="450" style="margin-left:.9%">
+        </object> -->
+         <object height="90%" width="100%" id="nvrTotalOcx" name="nvrTotalOcx"
+              classid="CLSID:96DFBBAF-4220-4978-9681-4ABA534A7718"
+              style="margin-top:20px"
+              >
+              <param name="BorderStyle" value="1" />
+              <param name="MousePointer" value="0" />
+              <param name="Enabled" value="1" />
+              <param name="Min" value="0" />
+              <param name="Max" value="10" />
+              <embed wmode="opaque"></embed>
+              <param name="wmode" value="transparent">
+         </object>
       </div>
     </div>
   </div>
@@ -45,22 +57,30 @@ export default {
       this.checkIE();
     },
     computed(){
-      this.initocx();
+     
     },
     mounted() {
-      VionVideo.Init(0, 'Null', 4);
-      try {
-        if (document.getElementById("VionVideo").GetVersion()) {
-        }
-      } catch (error) {
-        this.downloadOCx();
-      }
+      var testStr = 'Null';
+    	nvrTotalOcx.Init(0, testStr, 4);
+    	nvrTotalOcx.SetSingleWindow(true);
+    	nvrTotalOcx.SetParam("SetLanguage", "Chinese");
+    	nvrTotalOcx.SetParam("VideoSize", 0);
+    	var medianame = '视频0';
+    	 var hostname = window.location.hostname;
+    	 var port,url;
+       port=8554;
+      url = "rtsp://192.168.9.133:8554//opt/data/vedio/1579253441478.264";
+       let a = ''
+       setTimeout(()=>{
+        a = nvrTotalOcx.PlayRealVideo(url,1,'video','192.168.9.133',0);
+       },500)
+        setTimeout(()=>{
+        a = nvrTotalOcx.PlayRealVideo(url,1,'video','192.168.9.133',0);
+       },1000)
+       console.log('shipin'+a)
     },
     watch: {
-      playersrc(val) {
-        alert(1)
-        document.getElementById("VionVideo").StartPlay(val, 0);
-      },
+    
     },
     beforeDestroy: function () {
       if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) {
@@ -72,5 +92,8 @@ export default {
 </script>
 
 <style lang="stylus" scoped>
-
+.ocx-box{
+  height 50vh
+  width 35vw
+}
 </style>
diff --git a/src/views/trafficShow/index.vue b/src/views/trafficShow/index.vue
index df998d0..20ac321 100644
--- a/src/views/trafficShow/index.vue
+++ b/src/views/trafficShow/index.vue
@@ -7,8 +7,8 @@
           <!-- <eventList></eventList> -->
           <devInfo></devInfo>
         </div>
-        <div class="video-box">
-					<div class="video-box-close"></div>
+        <div class="video-box" v-show="ocxstatus">
+					<div class="video-box-close" @click="closeocx"></div>
 					
 						<!-- <mPlayvideo :playersrc="playurl"></mPlayvideo> -->
 						<!-- <videoPlay ref="mapvideo1" :playurl="playurl"></videoPlay> -->
@@ -105,7 +105,7 @@
 
 <script>
 // import mPlayvideo from "../public/mapvideo"
-import videoPlay from "../public/mapvideo";
+// import videoPlay from "../public/mapvideo";
 import videoPlay2 from "../public/mapvideo2";
 import showmap from "./map";
 import illegaltrend from "./illegaltrend";
@@ -122,10 +122,11 @@ export default {
       keyVehicleData: [],
       illageList: [],
       setShow: false,
+      ocxstatus:true,
       archiveUnid: 0,
       snap_num: 0,
 			playurl: {},
-			playurl2:{},
+			playurl2:"",
       audit_num: 0,
       snapData: {
         illega_total_snap_num: 0,
@@ -138,7 +139,7 @@ export default {
   components: {
 		showmap,
 		// mPlayvideo,
-		videoPlay,
+		// videoPlay,
 		videoPlay2,
     illegaltrend,
     eventTypedis,
@@ -158,14 +159,7 @@ export default {
 		// 		 this.$refs.mapvideo.videoPlay();
 		// 	},100)
 		// })
-				let obj = {}
-		 obj.rtsp_url = "rtsp://192.168.9.133:8554//opt/data/vedio/1579253441478.264";
-		this.playurl = obj
-		this.playurl2 = obj
-	setTimeout(() => {
-				this.$refs.mapvideo1.videoPlay();
-				this.$refs.mapvideo2.videoPlay();
-      }, 1000);
+				
 	
 	},
   methods: {
@@ -173,6 +167,9 @@ export default {
       //移动地图
       this.$refs.map.movemap(data);
     },
+    closeocx(){
+      this.ocxstatus=false;
+    },
     getTrafficSnap() {
       this.$api.show.getTrafficSnap().then(res => {
         this.snapData = res;
@@ -412,8 +409,8 @@ export default {
 
 .video-box {
   position: absolute;
-  height: 46.5vh;
-  width: 30vw;
+  height 48vh
+  width 35vw
   margin-bottom: 1vh;
   background: #f0f0f0;
   left: 0;
--
libgit2 0.24.0