This commit is contained in:
zhangsir
2024-06-03 20:49:09 +08:00
parent 4649a9db4a
commit 7d27f428b5
2 changed files with 9 additions and 2 deletions

View File

@@ -576,6 +576,7 @@ export default {
// 进度条到终点时修改播放状态 // 进度条到终点时修改播放状态
this.isShowPlayer = false this.isShowPlayer = false
this.$emit('onPlayerPlaying', this.videoDom.currentTime,this.videoDom.duration) this.$emit('onPlayerPlaying', this.videoDom.currentTime,this.videoDom.duration)
this.$emit('progress',this.currentProgress)
if (this.currentProgress === 1) { if (this.currentProgress === 1) {
this.isPlaying = false; this.isPlaying = false;
this.$emit('onPlayerEnded', {}) this.$emit('onPlayerEnded', {})

View File

@@ -27,7 +27,7 @@
<course-image v-if="courseInfo.id != ''" :course="courseInfo"></course-image> <course-image v-if="courseInfo.id != ''" :course="courseInfo"></course-image>
</div> </div>
<div v-if="resType == 10" style="position: relative;"> <div v-if="resType == 10" style="position: relative;">
<videoPlayer ref="myVideoPlayer" id="myVideoPlayer" :src="blobUrl" @onPlayerPlaying="onPlayerPlaying" <videoPlayer ref="myVideoPlayer" id="myVideoPlayer" @progress="progress" :src="blobUrl" @onPlayerPlaying="onPlayerPlaying"
:initTime="contentData.lastStudyTime" :notePlay="notePlay" @onPlayerPlay="onPlayerPlay" :initTime="contentData.lastStudyTime" :notePlay="notePlay" @onPlayerPlay="onPlayerPlay"
:isDrag="curriculumData.isDrag" @onFullscreen="onFullscreen" @onPlayerPause="onPlayerPause" :isDrag="curriculumData.isDrag" @onFullscreen="onFullscreen" @onPlayerPause="onPlayerPause"
@onPlayerEnded="onPlayerEnded" :isCrowd="isCrowd" @onTimeUpdate="handleAudioTimeUpdate"></videoPlayer> @onPlayerEnded="onPlayerEnded" :isCrowd="isCrowd" @onTimeUpdate="handleAudioTimeUpdate"></videoPlayer>
@@ -320,6 +320,7 @@
}, },
data() { data() {
return { return {
sendEventProgress: 0,
trueFalse: true, trueFalse: true,
audiences:'', audiences:'',
isCrowd:false, isCrowd:false,
@@ -1390,6 +1391,9 @@
} }
}); });
}, },
progress(val) {
this.sendEventProgress = val
},
saveStudyDuration(duration) { //保存本地存储的学习时长 saveStudyDuration(duration) { //保存本地存储的学习时长
if (duration > 0) { if (duration > 0) {
//发送用户学习事件 //发送用户学习事件
@@ -1405,7 +1409,9 @@
"objInfo": ""+this.courseInfo.name, "objInfo": ""+this.courseInfo.name,
"aid":this.userInfo.aid, //当前登录人的id "aid":this.userInfo.aid, //当前登录人的id
"aname":this.userInfo.name,//当前人的姓名 "aname":this.userInfo.name,//当前人的姓名
"status": 1 //状态 "status": 1, //状态
"contentId": this.contentData.id,
"progress": this.sendEventProgress,
} }
//静默处理 //静默处理
apiStat.sendEvent(postData).then(rs=>{ apiStat.sendEvent(postData).then(rs=>{