zengh
2021-09-01 29b139c875cadcb2314988dacf55fe7b845fa84e
public/map/popup/html/FlareClusterLayer_v3 copy.html
@@ -202,12 +202,12 @@
                        <!-- <div class="r-b-t-main">
                            <span class="r-b-t-left">设备标签</span>
                            <span class="r-b-t-right">
                                <div
                                class="r-b-t-r-label"
                                v-for="(value,index) in labels"
                                <div
                                class="r-b-t-r-label"
                                v-for="(value,index) in labels"
                                :key="index"
                                >
                                     {{value}}
                                     {{value}}
                                </div>
                            </span>
                        </div> -->
@@ -251,6 +251,7 @@
    </script>
    <script>
        var me = new Vue({
            el: '#appliutwo',
            data: {
@@ -309,7 +310,7 @@
                                }
                                // var imgdatas = imgD.data[0].paddress.split(',');
                                my.imgsl = imgdatas.length == 0 ? ['no'] : imgdatas;
                                // my.imgsl = [ //最多3张照片
                                // my.imgsl = [ //最多3张照片
                                //     "https://resource-city.sensoro.com/B8D675A3C4F71C5C8DE2FD764881BE57",
                                //     "https://resource-city.sensoro.com/1723C1A66DB44F792564F3648E5AA1EE",
@@ -402,8 +403,8 @@
                    // }
                    axios.get(url).then((res) => {
                        console.log(typeof res,34234534345341)
                        var data = JSON.parse(res);// JSON转js
                        my.ourd = data.data;
                        var data = res;// JSON转js
                        my.ourd = data.data.data;
                        my.deptname = my.ourd.deptName;
                    })
@@ -411,7 +412,7 @@
                handleClick(tab, event) {//标签tab点击事件
                    // console.log(tab, event);
                },
                openRealVideoBox(serialNumber, channelNumber) {
                  openRealVideoBox(serialNumber, channelNumber) {
                    var that = this;
                    var newAxios = axios.create({
                        baseURL: "https://web.byisf.com:18000",
@@ -421,56 +422,103 @@
                        },
                    });
                  if (that.ourd.manufacturers == "HK") {
                    axios({
                      method: "get",
                      url: `/api/blade-jfpts/equipment/equipment/selectEquimentPlayInfo?`,
                      params: {
                        number: that.ourd.deviceNumber,
                      },
                    }).then((res) => {
                      that.videoSource = res.data.data.data.url;
                      if (Hls.isSupported()) {
                        var dom = document.getElementById("real_video_conversation");
                        that.hls = new Hls();
                        var m3u8Url = decodeURIComponent(that.videoSource);
                        that.hls.loadSource(m3u8Url);
                        that.hls.attachMedia(dom);
                        that.hls.on(Hls.Events.MANIFEST_PARSED, function () {
                          dom.play();
                        });
                        that.hls.on(Hls.Events.ERROR, function (event, data) {
                          // console.log(data, 4566824159, "视频播放有问题!!!");
                          if (data.fatal) {
                            switch (data.type) {
                              case Hls.ErrorTypes.NETWORK_ERROR:
                                // try to recover network error
                                console.log(
                                  "fatal network error encountered, try to recover"
                                );
                                that.hls.startLoad();
                                break;
                              case Hls.ErrorTypes.MEDIA_ERROR:
                                console.log(
                                  "fatal media error encountered, try to recover"
                                );
                                that.hls.recoverMediaError();
                                break;
                            }
                          }
                        })
                      }
                    });
                  }else{
                    //this.form.serialNumber
                    newAxios
                        .post(
                            "/api_control",
                            {},
                            {
                                params: {
                                    param: JSON.stringify({ PktType: "GetAccessToken" }),
                                },
                      .post(
                        "/api_control",
                        {},
                        {
                          params: {
                            param: JSON.stringify({ PktType: "GetAccessToken" }),
                          },
                        }
                      )
                      .then((res) => {
                        newAxios
                          .get(
                            `https://web.byisf.com:18000/GetPlayUrl?deviceCode=${serialNumber}&chl=${channelNumber}`
                          )
                          .then((result) => {
                            that.videoSource = result.data.data.m3u8;
                            if (Hls.isSupported()) {
                              var dom = document.getElementById("real_video_conversation");
                              that.hls = new Hls();
                              var m3u8Url = decodeURIComponent(that.videoSource);
                              that.hls.loadSource(m3u8Url);
                              that.hls.attachMedia(dom);
                              that.hls.on(Hls.Events.MANIFEST_PARSED, function () {
                                dom.play();
                              });
                              that.hls.on(Hls.Events.ERROR, function (event, data) {
                                // console.log(data, 4566824159, "视频播放有问题!!!");
                                if (data.fatal) {
                                  switch (data.type) {
                                    case Hls.ErrorTypes.NETWORK_ERROR:
                                      // try to recover network error
                                      console.log(
                                        "fatal network error encountered, try to recover"
                                      );
                                      that.hls.startLoad();
                                      break;
                                    case Hls.ErrorTypes.MEDIA_ERROR:
                                      console.log(
                                        "fatal media error encountered, try to recover"
                                      );
                                      that.hls.recoverMediaError();
                                      break;
                                  }
                                }
                              })
                            }
                        )
                        .then((res) => {
                            newAxios
                                .get(
                                    `https://web.byisf.com:18000/GetPlayUrl?deviceCode=${serialNumber}&chl=${channelNumber}`
                                )
                                .then((result) => {
                                    that.videoSource = result.data.data.m3u8;
                                    if (Hls.isSupported()) {
                                        var dom = document.getElementById("real_video_conversation");
                                        that.hls = new Hls();
                                        var m3u8Url = decodeURIComponent(that.videoSource);
                                        that.hls.loadSource(m3u8Url);
                                        that.hls.attachMedia(dom);
                                        that.hls.on(Hls.Events.MANIFEST_PARSED, function () {
                                            dom.play();
                                        });
                                        that.hls.on(Hls.Events.ERROR, function (event, data) {
                                            // console.log(data, 4566824159, "视频播放有问题!!!");
                                            if (data.fatal) {
                                                switch (data.type) {
                                                    case Hls.ErrorTypes.NETWORK_ERROR:
                                                        // try to recover network error
                                                        console.log(
                                                            "fatal network error encountered, try to recover"
                                                        );
                                                        that.hls.startLoad();
                                                        break;
                                                    case Hls.ErrorTypes.MEDIA_ERROR:
                                                        console.log(
                                                            "fatal media error encountered, try to recover"
                                                        );
                                                        that.hls.recoverMediaError();
                                                        break;
                                                }
                                            }
                                        })
                                    }
                                })
                        })
                          })
                      })
                  }
                }
            },
            watch: {
@@ -504,4 +552,4 @@
    </script>
</body>
</html>
</html>