| | |
| | | import AMapLoader from "@amap/amap-jsapi-loader"; |
| | | import flvjs from "flv.js"; |
| | | import moment from 'moment' |
| | | import '../../utils/css/swfobject-h5.css' |
| | | import '../../utils/css/DPlayer.min.css' |
| | | import { |
| | | getCarCount, |
| | | getCarStatusCount, |
| | |
| | | carId: "", //监控车辆 |
| | | urlLink: '',//视频地址 |
| | | tableData: [], //预警情况统计数据 |
| | | |
| | | showFlv:false,//是否显示flv视频 |
| | | |
| | | |
| | | showFlv: false,//是否显示flv视频 |
| | | tokenID: 'shehongchuzu', |
| | | plugin: true, |
| | | oWebControl: null, //插件对象 |
| | |
| | | if (this.opencARiD) { |
| | | window.hstVideoPlay.historyCloseVideo(this.opencARiD, '1'); |
| | | } |
| | | this.oWebControl.JS_DestroyWnd(); |
| | | if (this.oWebControl != null) { |
| | | this.oWebControl.JS_DestroyWnd(); |
| | | } |
| | | |
| | | this.destroyPlayer(); |
| | | if (this.markers && this.markers.length > 0) { |
| | | this.markers.forEach((marker) => { |
| | |
| | | // 添加信息弹窗关闭事件监听 |
| | | this.infoWindow.on("close", () => { |
| | | this.destroyPlayer(); |
| | | if (this.oWebControl != null) { |
| | | this.oWebControl.JS_DestroyWnd(); |
| | | } |
| | | }); |
| | | this.map.on("click", (e) => { |
| | | this.infoWindow.close(); |
| | | if (this.oWebControl != null) { |
| | | this.oWebControl.JS_DestroyWnd(); |
| | | } |
| | | }); |
| | | this.getMapCarData(); |
| | | }) |
| | |
| | | |
| | | // 添加点击事件 |
| | | marker.on("click", async (e) => { |
| | | this.showFlv=false |
| | | this.showFlv = false |
| | | if (this.opencARiD) { |
| | | window.hstVideoPlay.historyCloseVideo(this.opencARiD, '1'); |
| | | } |
| | | this.opencARiD = item.id; |
| | | console.log("点击了车辆", item); |
| | | if (this.opencARiD) { |
| | | window.hstVideoPlay.historyCloseVideo(this.opencARiD, '1'); |
| | | } |
| | | |
| | | |
| | | // 如果已经有视频在播放,先销毁 |
| | | if (['17235341', '82296583'].includes(item.companyCode)) { |
| | |
| | | }, 1000); |
| | | }) |
| | | }); |
| | | } else if(item.companyCode=='25439966') { |
| | | } else if (item.companyCode == '25439966') { |
| | | this.IsHai = true; |
| | | getRealVideo({ id: item.id }).then(res => { |
| | | |
| | |
| | | } |
| | | }); |
| | | }) |
| | | }else{ |
| | | this.showFlv=true; |
| | | } else { |
| | | this.showFlv = true; |
| | | this.getVideoUrl(item.id) |
| | | } |
| | | this.infoWindow.open(this.map, e.target.getPosition()); |
| | |
| | | } |
| | | }); |
| | | }), |
| | | |
| | | |
| | | ]); |
| | | this.initVideoPlayer(); |
| | | |
| | |
| | | }) |
| | | ); |
| | | |
| | | |
| | | |
| | | } catch (error) { |
| | | this.infoWindow.setContent( |
| | | '<div style="padding: 20px;text-align: center;color: red;">获取车辆信息失败</div>' |
| | |
| | | |
| | | listRender(record) { |
| | | return `<div style="background: #ffffff; padding: 24px 20px;z-index: 999"> |
| | | <div style="position: relative; width: 460px; height: 330px"> |
| | | <div v-if="${this.showFlv}" style="width: 460px; height: 330px; border-radius: 9px; background: #f5f5f5; display: flex; justify-content: center; align-items: center; flex-direction: column"> |
| | | <div style="position: relative; width: 460px; height: 380px"> |
| | | <div v-if="${this.showFlv}" style="width: 460px; height: 260px; border-radius: 9px; background: #f5f5f5; display: flex; justify-content: center; align-items: center; flex-direction: column"> |
| | | <video |
| | | ref="video" |
| | | style="width: 460px; height: 330px; border-radius: 9px; display: none" |
| | |
| | | </video> |
| | | <el-empty description="暂无视频信息" :image-size="80"></el-empty> |
| | | </div> |
| | | <div v-else style="position: absolute; left: 0; top: 0; width: 100%; height: 100%;"> |
| | | <div id="hstplayer" v-if="${!this.IsHai} style="width: 460px; height: 230px;"></div> |
| | | <div id="divPlugin" class="divPlugin" style="width: 460px; height: 230px;" ref="divPlugin" v-if="${this.IsHai}"> </div> |
| | | <div v-else style="position: absolute; left: 0; top: 0;width: 460px; height: 200px;"> |
| | | <div id="hstplayer" v-if="${!this.IsHai} style="width: 460px; height: 200px;"></div> |
| | | <div id="divPlugin" class="divPlugin" style="width: 460px; height: 200px;" ref="divPlugin" v-if="${this.IsHai}"> </div> |
| | | </div> |
| | | <div style="display: flex;justify-content: space-between;margin-top: 15px;margin-bottom: 12px;"> |
| | | <div style="font-weight: 500;font-size: 18px;color: rgba(0, 0, 0, 0.85);line-height: 25px;">车牌号:${record.vehicleNumber || "" |