<template>
	<view>
		<view>
			<video-player 
				:url="fileUrl" 
				:name="title" 
				:drag="true"
				@onPlay="videoPlay"
				@onPause="videoPause"
				@onPlaying="videoPlaying"
				@onEnded="videoEnd">
			</video-player>
		</view>
		<!-- <view style="padding-top: 30px;display: flex;justify-content: center;">
			<button type="primary" @click="changeSrc">切换测试</button>
		</view> -->
	</view>
</template>

<script>
	export default{
		data(){
			return {
				fileUrl:'http:/127.0.0.1:9090/cdn/upload/course/2022/8/1013883711839379456.mp4',
				title:'测试播放',
				author:'',
			}
		},
		mounted() {
			//this.startAudioPlay();
		},
		methods:{
			startAudioPlay(){
				this.fileUrl='http://localhost:9090/cdn/upload/course/2022/5/979321410778959872.mp3';
				this.title='标题内容111';
				this.author='作者信息';
			},
			changeSrc(){
				this.fileUrl='http://localhost:9090/cdn/upload/course/2022/4/964853684964700160.mp3';
				this.title='标题内容22';
				this.author='作者信息';
			},
			videoPlay(){
				console.log('audioPlay');
			},
			videoEnd(){
				console.log('audioEnd');
			},
			videoPause(){
				console.log('audioPause');
			},
			videoPlaying(){
				console.log('audioPlaying');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.xaudio{
		
	}
</style>