Commit c832106c authored by lizhichao's avatar lizhichao

添加视频播放

parent d5eb15a4
...@@ -197,10 +197,11 @@ export default class Mutil { ...@@ -197,10 +197,11 @@ export default class Mutil {
} }
closeAllOverlays(){ closeAllOverlays(){
let lays=this.MAP.getOverlays().getArray(); let lays=this.MAP.getOverlays().clear();
lays.forEach((ele)=>{ // lays.forEach((ele)=>{
ele.setPosition(undefined) // ele.setPosition(undefined)
}) // that.MAP.addOverlay(overlay);
// })
} }
//增加标注弹窗 //增加标注弹窗
addPopup(popConHtml, id, longitude, latitude) { addPopup(popConHtml, id, longitude, latitude) {
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
<!-- <button @click="Mutil.tianSlC()" class="map-botton">切换3</button> --> <!-- <button @click="Mutil.tianSlC()" class="map-botton">切换3</button> -->
</div> </div>
<div v-show="isShowVideo" style="display: none;position:absolute;left:1000px;top:10px;z-index: 2;background-color: #0BD30B;width: 400px;height: 300px;">
<div id="div_video"></div>
</div>
</div> </div>
...@@ -66,7 +68,7 @@ ...@@ -66,7 +68,7 @@
<div class="markBox"> <div class="markBox">
<div style="float: left;background-color: aquamarine;text-align: center;"> <div style="float: left;background-color: aquamarine;text-align: center;">
<el-tooltip :disabled="disabled" content="企业注册" placement="left" effect="light" style="margin-left: 25%;"> <el-tooltip content="企业注册" placement="left" effect="light" style="margin-left: 25%;">
<div @click="mapqiye"> <div @click="mapqiye">
<img width="15px" src="@/assets/mark/markqy.png" /> <img width="15px" src="@/assets/mark/markqy.png" />
</div> </div>
...@@ -77,7 +79,7 @@ ...@@ -77,7 +79,7 @@
<span>{{tjNumberObj.enterpriseRegNum}}</span> <span>{{tjNumberObj.enterpriseRegNum}}</span>
</div> </div>
<div style="float: left;text-align: center;"> <div style="float: left;text-align: center;">
<el-tooltip :disabled="disabled" content="危险源" placement="left" effect="light"> <el-tooltip content="危险源" placement="left" effect="light">
<div @click="mapwxy"> <div @click="mapwxy">
<img width="20px" src="@/assets/mark/weixianyuan.png" /> <img width="20px" src="@/assets/mark/weixianyuan.png" />
</div> </div>
...@@ -88,7 +90,7 @@ ...@@ -88,7 +90,7 @@
<span>{{tjNumberObj.dangerNum}}</span> <span>{{tjNumberObj.dangerNum}}</span>
</div> </div>
<div style="float: left;"> <div style="float: left;">
<el-tooltip :disabled="disabled" content="监控监测点" placement="left" effect="light"> <el-tooltip content="监控监测点" placement="left" effect="light">
<div @click="mapshipin"> <div @click="mapshipin">
<img width="20px" src="@/assets/mark/jiankong.png" /> <img width="20px" src="@/assets/mark/jiankong.png" />
</div> </div>
...@@ -99,7 +101,7 @@ ...@@ -99,7 +101,7 @@
<span>{{tjNumberObj.cameraNum}}</span> <span>{{tjNumberObj.cameraNum}}</span>
</div> </div>
<div style="float: left;"> <div style="float: left;">
<el-tooltip :disabled="disabled" content="职业危害场所" placement="left" effect="light"> <el-tooltip content="职业危害场所" placement="left" effect="light">
<div> <div>
<img width="20px" src="@/assets/mark/weihaichangsuo.png" /> <img width="20px" src="@/assets/mark/weihaichangsuo.png" />
</div> </div>
...@@ -110,7 +112,7 @@ ...@@ -110,7 +112,7 @@
<span>2</span> <span>2</span>
</div> </div>
<div style="float: left;"> <div style="float: left;">
<el-tooltip :disabled="disabled" content="隐患" placement="left" effect="light"> <el-tooltip content="隐患" placement="left" effect="light">
<div> <div>
<img width="20px" src="@/assets/mark/yinhuan.png" /> <img width="20px" src="@/assets/mark/yinhuan.png" />
</div> </div>
...@@ -171,7 +173,8 @@ export default class GIS extends Vue { ...@@ -171,7 +173,8 @@ export default class GIS extends Vue {
@Provide() Mutil: any; @Provide() Mutil: any;
@Provide() mapLoadDone = false; @Provide() mapLoadDone = false;
@Provide() MAP: any; @Provide() MAP: any;
@Provide() isShowVideo:boolean=false;
@Provide() player:any;
@Provide() mapOption = { @Provide() mapOption = {
plugin: [{ plugin: [{
pName: "MapType", pName: "MapType",
...@@ -197,6 +200,7 @@ export default class GIS extends Vue { ...@@ -197,6 +200,7 @@ export default class GIS extends Vue {
// city: "石家庄", // city: "石家庄",
// citylimit: true, // citylimit: true,
// }; // };
@Provide() lastVideoPlayId:any="";
@Provide() markersB: any = []; @Provide() markersB: any = [];
@Provide() toolobj: any; @Provide() toolobj: any;
@Provide() mouseTool: any; //测量工具 @Provide() mouseTool: any; //测量工具
...@@ -313,31 +317,28 @@ export default class GIS extends Vue { ...@@ -313,31 +317,28 @@ export default class GIS extends Vue {
} }
getshipinWindowInfo(deviceId: string) { getshipinWindowInfo(deviceId: string) {
let that = this; let that = this;
// (window as any).checkDetail = function (param: string) { this.closeVideo();
// that.$router.push({
// path: "/EnDetail",
// query: {
// enterpriseId: param
// }
// });
// };
METHOD.axiosGet( METHOD.axiosGet(
that, that,
`/safetyDeviceInfo/getSafetyDeviceInfoById/${deviceId}`, `/safetyDeviceInfo/getSafetyDeviceInfoById/${deviceId}`,
function (res: any) { function (res: any) {
if (res.code == 0) { if (res.code == 0) {
let device = res.data, let device = res.data;
html = `<div class="windowDg"><h3>${device.deviceName}</h3>` + `<div id="playerWindow" class="playerWindow"></div>` + `</div>`; that.isShowVideo=true;
that.player.play('http://27.128.189.137:18000/flv/hls/stream_88_0.flv' , 1);
that.Mutil.addPopup(html, device.id, device.longitude, device.latitude) that.lastVideoPlayId="stream_88_0";//记录上次播放的视频ID
alert(2)
var player = new WasmPlayer(null, "playerWindow", null, {Height: true});
player.play('http://27.128.189.137:18000/flv/hls/stream_88_0.flv' , 1);
console.log(device,"de-----") console.log(device,"de-----")
} }
} }
); );
} }
//关闭视频方法
closeVideo(){
if(this.lastVideoPlayId!=""){
this.player.stop('http://27.128.189.137:18000/flv/hls/'+this.lastVideoPlayId+'.flv' , 1);
}
this.isShowVideo=false;
}
addMark(obj: any, index: any) { addMark(obj: any, index: any) {
let icon, let icon,
that = this; that = this;
...@@ -488,6 +489,8 @@ export default class GIS extends Vue { ...@@ -488,6 +489,8 @@ export default class GIS extends Vue {
} }
mounted() { mounted() {
let that = this; let that = this;
that.player = new WasmPlayer(null, "div_video", null, {Height: true});
that.mapLoadDone = true; that.mapLoadDone = true;
that.Mutil = new Mutil("mapbox"); that.Mutil = new Mutil("mapbox");
that.MAP = that.Mutil.MAP; that.MAP = that.Mutil.MAP;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment