<template>
	<view id="videoPlayer">
		<web-view :src="webViewUrl" v-if="pageType"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageType:false,
				webViewUrl:'',
			}
		},
		onLoad(option) {
			let obj = JSON.parse(decodeURIComponent(option.item))
			let url = '';
			// if(obj.type == 4){
			// 	url = uni.getStorageSync('cameraExtranetAgent')+'?source=2&mpegts=true&type=4&subId='+obj.subId+'&touken='+uni.getStorageSync('token')
			// }else if(obj.type == 5){
			// 	url = uni.getStorageSync('cameraExtranetAgent')+'?source=5&mpegts=true&type=5&floorId='+obj.floorId+'&subId='+obj.subId+'&touken='+uni.getStorageSync('token')
			// }
			if(obj.type == 4){
				url = uni.getStorageSync('cameraExtranetAgent')+'?videoBroadcastHls=true&source=2&type=4&floorId='+obj.floorId+'&subId='+obj.subId+'&touken='+uni.getStorageSync('token')
			}else if(obj.type == 5){
				url = uni.getStorageSync('cameraExtranetAgent')+'?videoBroadcastHls=true&source=5&type=5&floorId='+obj.floorId+'&subId='+obj.subId+'&touken='+uni.getStorageSync('token')
			}
			this.$set(this,'webViewUrl',url);
			this.$set(this,'pageType',true);
		},
		onShow(){
			
		},
		methods: {
			
		}
	}
</script>

<style lang="stylus" scoped>
	#videoPlayer{
		height: 100%;
		display flex;
		flex-direction column;
	}
</style>
