Files
learning-system-mobile/pages/study/videoTest.vue
2022-11-18 13:59:04 +08:00

69 lines
1.3 KiB
Vue

<template>
<view>
<view>
<video-player
:url="fileUrl"
:name="title"
:inittime="initTime"
:drag="true"
@play="videoPlay"
@pause="videoPause"
@playing="videoPlaying"
@ended="videoEnd"
@fullscreenchange="videoScreen">
</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:'/static/temp/test.mp4',
initTime:20,
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('videoPlay');
},
videoEnd(){
console.log('videoEnd');
},
videoPause(){
console.log('videoPause');
},
videoPlaying(){
console.log('videoPlaying');
},
videoScreen(e){
console.log('全屏',e);
}
}
}
</script>
<style lang="scss" scoped>
.xaudio{
}
</style>