<template>
	<view v-if="url!=null && url!==''">
		<web-view  :src="url" />
	</view>
	<view v-else style="display: flex; align-items: center; height: 30vh; justify-content: center; color: #666;">
		抱歉，该课件暂不支持查看！
	</view>
</template>
<script>
	export default {
		components: {

		},

		data() {
			return {
				courseId: '',
				liveId: '',
				url: ''
			}
		},
		onLoad: function(option) {

			this.courseId = option.courseId
			this.liveId = option.liveId
			// 解码后重新加密
			const param = decodeURIComponent(option.url)
			this.url = `${this.$urls.api}/player/live.html?source=${encodeURIComponent(param)}`
			console.log('full', this.url)
		},

		methods: {

			statechange(e) {
				console.log('live-player code:', e.detail.code)
			},
			error(e) {
				console.error('live-player error:', e.detail.errMsg)
			}

		}

	}
</script>
