<template>
	<view :class="'video-box ' + (isMine ? 'my-video' : '')" @click="playerHander">
		<image :src="message.payload.thumbUrl" mode="aspectFill" class="poster"></image>
		<image :src="`${assetsUrl}talk-playing.png`" mode="aspectFit" class="video-icon"></image>
	</view>
</template>

<script>
export default {
	data() {
		return {
			isPlay: false,
			assetsUrl:this.$util.assetsUrl,
		};
	},

	components: {},
	props: {
		message: {
			type: Object,
			default: () => {}
		},
		isMine: {
			type: Boolean,
			default: true
		}
	},
	watch: {
		message: {
			handler: function(newVal) {
				this.message=newVal;
				// this.setData({
				// 	message: newVal
				// });
			},
			immediate: true,
			deep: true
		}
	},
	onLoad() {
		console.log(this.message)
	},
	methods: {
		playerHander() {
			uni.$emit('videoPlayerHandler', {
				isPlay: true,
				message: this.message
			});
		},
		stopHander() {
			this.isPlay = false;
		}
	}
};
</script>
<style>
@import './index.css';
</style>
