Commit 240671f8 authored by zhanglw's avatar zhanglw

sos声音+前台弹出

parent 55b47888
......@@ -2,14 +2,14 @@ ENV = 'development'
# 接口地址
#VUE_APP_BASE_API = 'http://39.164.225.220:5002'
#VUE_APP_LOCAL_API = 'http://39.164.225.220:5002'
VUE_APP_BASE_API = 'http://39.164.225.220:5002'
VUE_APP_LOCAL_API = 'http://39.164.225.220:5002'
#VUE_APP_BASE_API = 'http://192.168.3.23:9400'
#VUE_APP_LOCAL_API = 'http://192.168.3.23:9400'
VUE_APP_BASE_API = 'http://60.212.188.152:9400'
VUE_APP_LOCAL_API = 'http://60.212.188.152:9400'
#VUE_APP_BASE_API = 'http://60.212.188.152:9400'
#VUE_APP_LOCAL_API = 'http://60.212.188.152:9400'
VUE_APP_LOCAL_API2 = 'http://192.168.3.23:9400'
VUE_APP_WS_API = 'ws://192.168.3.23:9400/webSocket'
......
......@@ -53,6 +53,7 @@
<script>
import {HttpReq} from '@/assets/js/common.js';
import JsSIP from 'jssip'
import alarm from "@/assets/audio/alarm.mp3";
export default {
data() {
......@@ -66,6 +67,8 @@ export default {
callSipId: null,
status: 0,
isReady: false,
audio: null,
loopAgain: false,
message: '正在建立链接,等待服务器响应...',
sosDialTimer: null
}
......@@ -122,6 +125,21 @@ export default {
})
},
methods: {
audioPlayByUrl(url) {
this.$nextTick(() => {
this.audio = document.createElement("audio");
this.audio.currentTime = 0;
this.audio.src = url;
setTimeout(()=>{
this.audio.addEventListener('ended', ()=> {
if (this.loopAgain) {
this.audio.play();
}
}, false);
this.audio.play();
}, 1500)
})
},
uaRegister() {
let sip_uri_ = `sip:${this.uaSipInfo.adminsip_id}@${this.uaSipInfo.adminwsip_host}`;
let sip_password_ = `${this.uaSipInfo.adminsip_pwd}`;
......@@ -251,6 +269,7 @@ export default {
this.userAgent.start();
},
uaCall() {
this.loopAgain = false
if (this.isReady || this.userAgent) {
let sip_phone_number_ = `sip:${this.uaSipInfo.room_id}@${this.uaSipInfo.adminwsip_host}`;
let options = {
......@@ -293,6 +312,7 @@ export default {
}
},
uaHangup() {
this.loopAgain = false
if (this.isReady || this.userAgent) {
this.isReady = false
this.userAgent.terminateSessions();
......@@ -327,9 +347,12 @@ export default {
},
showView() {
this.visible = true
this.loopAgain = true
this.audioPlayByUrl(alarm);
},
hideView() {
this.visible = false
this.loopAgain = false
this.uaHangup()
},
cancelView() {
......
......@@ -19,7 +19,7 @@
</template>
<script>
import dialView from "./dialView";
import dialView from "@/components/DialView/index";
export default {
name: 'AppMain',
components: { dialView },
......
<template>
<div class="bigScreenView">
<dial-view ref="dialView" />
<!-- 头部标题 -->
<div class="top_title" style="text-align: center">
<span class="projectName">恒源矿业二道庄矿区智慧矿山</span>
......@@ -121,8 +122,11 @@ import 'video.js/dist/video-js.css'
import videojs from 'video.js'
import 'videojs-contrib-hls'
import dialView from "@/components/DialView/index";
export default {
components: {
dialView,
carsEZUIKitJs,
kaungEZUIKitJs,
DPcomputer1,
......@@ -196,6 +200,9 @@ export default {
}
},
mounted() {
this.$nextTick(() => {
this.$refs.dialView.init()
})
this.loadData();
//右上角时钟
this.setNowTimes();
......
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