|
|
@@ -35,6 +35,7 @@
|
|
|
deviceId: '', // 设备号
|
|
|
// 播放地址
|
|
|
cameraAddress: '',
|
|
|
+ playerVideo: null,
|
|
|
// 控制参数
|
|
|
controlParams: {
|
|
|
device_id: '', //设备号
|
|
|
@@ -43,10 +44,14 @@
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
- onLoad(options) {
|
|
|
+ onLoad(options) {
|
|
|
this.deviceId = options.id;
|
|
|
this.controlParams.device_id = options.id;
|
|
|
-
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ if (this.playerVideo) {
|
|
|
+ this.playerVideo.dispose();
|
|
|
+ }
|
|
|
},
|
|
|
async onReady() {
|
|
|
await this.getCameraAddress();
|
|
|
@@ -59,11 +64,11 @@
|
|
|
video.setAttribute('webkit-playsinline', true) //这个bai属性是ios 10中设置可以让视频在小du窗内播放,也就是不是全zhi屏播放的video标签的一个属性
|
|
|
video.setAttribute('x5-video-player-type', 'h5') //安卓 声明启用同层H5播放器 可以在video上面加东西
|
|
|
let source = document.createElement('source');
|
|
|
- source.src =this.cameraAddress;
|
|
|
+ source.src = this.cameraAddress;
|
|
|
video.appendChild(source);
|
|
|
this.$refs.video.$el.appendChild(video);
|
|
|
let that = this;
|
|
|
- let player = this.$video('video', {
|
|
|
+ this.playerVideo = this.$video('video', {
|
|
|
poster: '', // 视频封面图地址
|
|
|
title: '4564564',
|
|
|
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
|
|
|
@@ -105,7 +110,7 @@
|
|
|
});
|
|
|
let address = eval("(" + res + ")")
|
|
|
console.log(address.hls);
|
|
|
- this.cameraAddress=address.hls;
|
|
|
+ this.cameraAddress = address.hls;
|
|
|
},
|
|
|
// 控制摄像机
|
|
|
async controlDirection(movenum) {
|