mapvideo2.vue 2.76 KB
<template>
  <div class="item">
    <div class="player">
      <div class="ocx-box">
        <!-- <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>
</template>
<script>

export default {
    data() {
      return {};
    },
    props: ["playersrc", "vnum"],
    methods: {
      initocx(){
         VionVideo.Init(0, 'Null', 4);
      },
      downloadOCx() {
        if (navigator.userAgent.indexOf('Trident') > -1) {
          this.axios.get(IP + "/api/v1/device/dlfile", {
              params: {
                file_type: "video_ocx"
              }
            })
            .then(response => {
              location.href = response.data.file_url;
            });
        } else {
          this.$message.error("视频控件加载失败请用IE10及以上版本打开!");
        }
      },
      checkIE() {
        var agent = navigator.userAgent.toLowerCase();
        if (/(msie\s|trident.*rv:)([\w.]+)/.test(agent) && document.documentMode < 10) {
          this.$message.error("IE 版本过低请升级到IE10级以上版本!");
        }
      }
    },
    created() {
      this.checkIE();
    },
    computed(){
     
    },
    mounted() {
      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: {
    
    },
    beforeDestroy: function () {
      // if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) {
      //   this.videoplayer.pause();
      // }
    }
  };

</script>

<style lang="stylus" scoped>
.ocx-box{
  height 50vh
  width 35vw
}
</style>