<template>
	<view>
		<view class="action">
			<text>{{deviceName}}</text>
		</view>
		<view class="look">
			<live-player :src="address" autoplay @error="wbg"></live-player>
		</view>
	</view>
</template>

<script>
	import {direct} from '../api/Supervisory/Supervisory.js'
	export default {
		data() {
			return {
				address:'rtmp://106.52.134.22/live/34020000002000000001@34020000001320000011',
				deviceName:'',
				lampPoleLocation:''
			};
		},
		methods:{
			perror(e){
				console.log(e)
			},
			wbg(e){
				console.log(e.detail)
			}
		},
		onLoad(e) {
			var index = e.index
			var index2 = e.index2
			direct().then(res =>{
				if(res.code == 200){
					const data = res.data[index].cameraList[index2]
					// this.address = data.monitorAddress
					this.deviceName = data.deviceName
					this.lampPoleLocation = data.lampPoleLocation
				}
			})
		}
	}
</script>

<style lang="scss">
	.action{
		width: 750rpx;
		height: 110rpx;
		font-size: 40rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #dedada;
	}
	.look{
		width: 750rpx;
		height: 400rpx;
		live-player{
			width: 100%;
			height: 100%;
		}
	}
</style>
