|
@@ -299,7 +299,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 摄像头预览对话框 -->
|
|
<!-- 摄像头预览对话框 -->
|
|
|
- <CameraPreview v-model="previewVisible" :camera="currentCamera" />
|
|
|
|
|
|
|
+ <!-- <CameraPreview v-model="previewVisible" :camera="currentCamera" /> -->
|
|
|
|
|
|
|
|
<!-- 单个摄像头全屏模式 -->
|
|
<!-- 单个摄像头全屏模式 -->
|
|
|
<div v-if="singleCameraFullscreen.show" class="single-camera-fullscreen">
|
|
<div v-if="singleCameraFullscreen.show" class="single-camera-fullscreen">
|
|
@@ -996,17 +996,18 @@ nextPage() {
|
|
|
location: '智慧农场六号',
|
|
location: '智慧农场六号',
|
|
|
// previewUrl: 'https://azn.gbdfarm.com/video-proxy/',
|
|
// previewUrl: 'https://azn.gbdfarm.com/video-proxy/',
|
|
|
//previewUrl: 'wss://121.4.16.100:443/rtp/34020000001110000001_34020000001320000012.live.flv',
|
|
//previewUrl: 'wss://121.4.16.100:443/rtp/34020000001110000001_34020000001320000012.live.flv',
|
|
|
- previewUrl: 'wss://nxy.gbdfarm.com:9000/rtp/34020000001110000001_34020000001320000012.live.flv',
|
|
|
|
|
|
|
+ previewUrl: 'wss://azn.gbdfarm.com:443/rtp/34020000001110000001_34020000001320000012.live.flv',
|
|
|
|
|
+ //previewUrl: 'wss://azn.gbdfarm.com:443/rtp/34020000001320000001_34020000001320000001.live.flv',
|
|
|
|
|
|
|
|
domId: 'camera-1'
|
|
domId: 'camera-1'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 2,
|
|
id: 2,
|
|
|
name: '葡萄园一号摄像头',
|
|
name: '葡萄园一号摄像头',
|
|
|
- status: '离线',
|
|
|
|
|
|
|
+ status: '在线',
|
|
|
location: '智慧农场六号',
|
|
location: '智慧农场六号',
|
|
|
//previewUrl: 'http://121.4.16.100:28080/#/play/wasm/' + encodeURIComponent('ws://121.4.16.100:6080/rtp/34020000001320000001.live.flv'),
|
|
//previewUrl: 'http://121.4.16.100:28080/#/play/wasm/' + encodeURIComponent('ws://121.4.16.100:6080/rtp/34020000001320000001.live.flv'),
|
|
|
- previewUrl: '',
|
|
|
|
|
|
|
+ previewUrl: 'wss://azn.gbdfarm.com:443/rtp/34020000001320000001_34020000001320000001.live.flv',
|
|
|
domId: 'camera-2'
|
|
domId: 'camera-2'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -1139,14 +1140,14 @@ initFlvPlayer(cam) {
|
|
|
hasAudio: false, // 根据实际流调整
|
|
hasAudio: false, // 根据实际流调整
|
|
|
hasVideo: true
|
|
hasVideo: true
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
flvPlayer.attachMediaElement(videoElement)
|
|
flvPlayer.attachMediaElement(videoElement)
|
|
|
flvPlayer.load()
|
|
flvPlayer.load()
|
|
|
flvPlayer.play()
|
|
flvPlayer.play()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存播放器实例
|
|
// 保存播放器实例
|
|
|
this.$set(this.playerInstances, cam.id, flvPlayer)
|
|
this.$set(this.playerInstances, cam.id, flvPlayer)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
console.log(`摄像头 ${cam.id} 播放器初始化成功`)
|
|
console.log(`摄像头 ${cam.id} 播放器初始化成功`)
|
|
|
} else {
|
|
} else {
|
|
|
console.error('浏览器不支持 FLV 播放')
|
|
console.error('浏览器不支持 FLV 播放')
|
|
@@ -1606,23 +1607,28 @@ destroyAllPlayers() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
- const query = { deviceId: '34020000001110000001' };
|
|
|
|
|
- const query2 = { deviceId: '34020000001320000001' };
|
|
|
|
|
-
|
|
|
|
|
- playback(query).then(response => {
|
|
|
|
|
|
|
+ // 页面加载时自动开启摄像头播放
|
|
|
|
|
+ const deviceIds = ['34020000001110000001', '34020000001320000001']
|
|
|
|
|
+
|
|
|
|
|
+ deviceIds.forEach(deviceId => {
|
|
|
|
|
+ playback({ deviceId }).then(response => {
|
|
|
|
|
+ console.log(`设备 ${deviceId} 播放启动成功:`, response)
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ console.error(`设备 ${deviceId} 播放启动失败:`, error)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
/* playback(query2).then(response => {
|
|
/* playback(query2).then(response => {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.iframeSrc = "http://121.4.16.100:28080/#/play/wasm/"+encodeURIComponent(response.msg);
|
|
this.iframeSrc = "http://121.4.16.100:28080/#/play/wasm/"+encodeURIComponent(response.msg);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}) */
|
|
}) */
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
// 清理所有播放器实例
|
|
// 清理所有播放器实例
|
|
|
this.destroyAllPlayers()
|
|
this.destroyAllPlayers()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 清理所有轮播定时器
|
|
// 清理所有轮播定时器
|
|
|
Object.values(this.carouselTimers).forEach(timer => {
|
|
Object.values(this.carouselTimers).forEach(timer => {
|
|
|
if (timer) {
|
|
if (timer) {
|
|
@@ -1644,7 +1650,7 @@ destroyAllPlayers() {
|
|
|
this.chartInstance.dispose()
|
|
this.chartInstance.dispose()
|
|
|
this.chartInstance = null
|
|
this.chartInstance = null
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 停止播放
|
|
// 停止播放
|
|
|
const query = { deviceId: '34020000001110000001' }
|
|
const query = { deviceId: '34020000001110000001' }
|
|
|
const query2 = { deviceId: '34020000001320000001' }
|
|
const query2 = { deviceId: '34020000001320000001' }
|