<template>
	<view class="container">
		<web-view :src="'/hybrid/html/h5player.html?url=' + this.url"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: '',
				player: null,
				info:{}
			}
		},
		onLoad(options) {
			console.log('options ===>',options.item)
			this.info = JSON.parse(options.item)
			console.log('info ===>',JSON.parse(this.info.tags))
			if(this.info){
				let val = JSON.parse(this.info.tags);
				if(val.cameraIndexCode){
					let params = {
						cameraIndexCode:val.cameraIndexCode
					}
					uni.request({
						url: getApp().globalData.apiUrl + '/alarmInformation/preview',
						method: 'GET',
						params,
						success: (res) => {
							console.log('res ===>',res)
							if(res.data.code === 0 || res.data.code == 200) {
								this.url = res.data.url
							}
						},
						fail: (err) => {
							console.log(err)
						}
					})
				}
			}
			// this.url = options.url ? decodeURIComponent(options.url) :
			// 	'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv';
		},
		mounted() {
		},
		methods: {
		}
	}
</script>

<style lang="scss" scoped>
	page,
	.container {
		min-height: 100vh;
		background-color: #fff;
	}
</style>