mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 09:56:45 +08:00
调整测试修改
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<video id="myVideo" style="width: 100%;"
|
||||
:src="fileBaseUrl+coursewareInfo.content.content"
|
||||
:src="url"
|
||||
@error="videoErrorCallback"
|
||||
:initial-time="videoPlayingTime"
|
||||
@play="onPlayerPlay"
|
||||
@@ -40,6 +40,7 @@
|
||||
fullScreenFlag: false,
|
||||
currtime:'00:00:00',//当前播放时间 字符串 计算后
|
||||
druationTime:'00:00:00',//总时间 字符串 计算后
|
||||
videoPlayingTime:0,
|
||||
bool:false,
|
||||
sliderValue: 0, //控制进度条slider的值,
|
||||
updateState: false, //防止视频播放过程中导致的拖拽失效
|
||||
@@ -58,6 +59,9 @@
|
||||
// this.fullScreenFlag ? this.bool=true : this.bool=false;
|
||||
this.fullScreenFlag=!this.fullScreenFlag;
|
||||
},
|
||||
videoErrorCallback(e){
|
||||
console.log(e,'播放错误');
|
||||
},
|
||||
// 根据秒获取时间
|
||||
formatSeconds(a) {
|
||||
var hh = parseInt(a/3600);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<audio-player
|
||||
v-if="url2"
|
||||
:src="url2"
|
||||
<video-player
|
||||
:url="fileUrl"
|
||||
:name="title"
|
||||
:drag="true"
|
||||
@onPlay="audioPlay"
|
||||
@onPause="audioPause"
|
||||
@onPlaying="audioPlaying"
|
||||
@onEnded="audioEnd">
|
||||
</audio-player>
|
||||
@onPlay="videoPlay"
|
||||
@onPause="videoPause"
|
||||
@onPlaying="videoPlaying"
|
||||
@onEnded="videoEnd">
|
||||
</video-player>
|
||||
</view>
|
||||
<view style="padding-top: 30px;display: flex;justify-content: center;">
|
||||
<!-- <view style="padding-top: 30px;display: flex;justify-content: center;">
|
||||
<button type="primary" @click="changeSrc">切换测试</button>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -22,35 +21,35 @@
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
url2:'',
|
||||
title:'',
|
||||
fileUrl:'http:/127.0.0.1:9090/cdn/upload/course/2022/8/1013883711839379456.mp4',
|
||||
title:'测试播放',
|
||||
author:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.startAudioPlay();
|
||||
//this.startAudioPlay();
|
||||
},
|
||||
methods:{
|
||||
startAudioPlay(){
|
||||
this.url2='http://localhost:9090/cdn/upload/course/2022/5/979321410778959872.mp3';
|
||||
this.fileUrl='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.fileUrl='http://localhost:9090/cdn/upload/course/2022/4/964853684964700160.mp3';
|
||||
this.title='标题内容22';
|
||||
this.author='作者信息';
|
||||
},
|
||||
audioPlay(){
|
||||
videoPlay(){
|
||||
console.log('audioPlay');
|
||||
},
|
||||
audioEnd(){
|
||||
videoEnd(){
|
||||
console.log('audioEnd');
|
||||
},
|
||||
audioPause(){
|
||||
videoPause(){
|
||||
console.log('audioPause');
|
||||
},
|
||||
audioPlaying(){
|
||||
videoPlaying(){
|
||||
console.log('audioPlaying');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user