mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-09 02:46:46 +08:00
增加一个视频播放插件
This commit is contained in:
@@ -74,8 +74,9 @@
|
||||
{"path" : "pages/login/nickName","style" : {"navigationBarTitleText": "修改昵称"}},
|
||||
{"path" : "pages/login/newBirt","style" : {"navigationBarTitleText": "修改生日"}},
|
||||
{"path" : "pages/login/indLabels","style" : {"navigationBarTitleText": "修改个人标签"}},
|
||||
{"path" : "pages/study/courseStudy","style" : {"navigationBarTitleText": "课程学习"}},
|
||||
{"path" : "pages/study/audioTest","style" : {"navigationBarTitleText": "音频测试"}},
|
||||
{"path" : "pages/study/courseStudy","style" : {"navigationBarTitleText": "课程学习"}}
|
||||
{"path" : "pages/study/videoTest","style" : {"navigationBarTitleText": "视频频测试"}}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
||||
64
pages/study/videoTest.vue
Normal file
64
pages/study/videoTest.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<audio-player
|
||||
v-if="url2"
|
||||
:src="url2"
|
||||
:name="title"
|
||||
:drag="true"
|
||||
@onPlay="audioPlay"
|
||||
@onPause="audioPause"
|
||||
@onPlaying="audioPlaying"
|
||||
@onEnded="audioEnd">
|
||||
</audio-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 {
|
||||
url2:'',
|
||||
title:'',
|
||||
author:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.startAudioPlay();
|
||||
},
|
||||
methods:{
|
||||
startAudioPlay(){
|
||||
this.url2='http://localhost:9090/cdn/upload/course/2022/5/979321410778959872.mp3';
|
||||
this.title='标题内容111';
|
||||
this.author='作者信息';
|
||||
},
|
||||
changeSrc(){
|
||||
this.url2='http://localhost:9090/cdn/upload/course/2022/4/964853684964700160.mp3';
|
||||
this.title='标题内容22';
|
||||
this.author='作者信息';
|
||||
},
|
||||
audioPlay(){
|
||||
console.log('audioPlay');
|
||||
},
|
||||
audioEnd(){
|
||||
console.log('audioEnd');
|
||||
},
|
||||
audioPause(){
|
||||
console.log('audioPause');
|
||||
},
|
||||
audioPlaying(){
|
||||
console.log('audioPlaying');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.xaudio{
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user