mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 19:06:43 +08:00
还原拉取进度条的时间
This commit is contained in:
@@ -292,8 +292,6 @@ export default {
|
|||||||
fullTimeFormat: "00:00:00", // 视频总长度的文字
|
fullTimeFormat: "00:00:00", // 视频总长度的文字
|
||||||
barrageTimelineStart: 0, // 弹幕时间轴的起始时间点(手动调整进度条触发更新)
|
barrageTimelineStart: 0, // 弹幕时间轴的起始时间点(手动调整进度条触发更新)
|
||||||
isInit:false, // 是否初始化过
|
isInit:false, // 是否初始化过
|
||||||
videoTime:0,
|
|
||||||
oldVideoTime:0,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -378,9 +376,6 @@ export default {
|
|||||||
this.videoDom.pause();
|
this.videoDom.pause();
|
||||||
this.isPlaying = false;
|
this.isPlaying = false;
|
||||||
this.$emit('onPlayerPause', {})//暂停(暂停时调用)
|
this.$emit('onPlayerPause', {})//暂停(暂停时调用)
|
||||||
// 清楚记录的时间
|
|
||||||
this.videoTime = 0
|
|
||||||
this.oldVideoTime = 0
|
|
||||||
}
|
}
|
||||||
this.isShowCover = false;
|
this.isShowCover = false;
|
||||||
},
|
},
|
||||||
@@ -561,18 +556,6 @@ export default {
|
|||||||
this.isPlaying = false;
|
this.isPlaying = false;
|
||||||
this.$emit('onPlayerEnded', {})
|
this.$emit('onPlayerEnded', {})
|
||||||
}
|
}
|
||||||
// 拉伸进度条计时长
|
|
||||||
if(this.isPlaying){
|
|
||||||
this.videoTime = this.videoDom.currentTime
|
|
||||||
let sendTime = this.videoTime -this.oldVideoTime
|
|
||||||
// console.log('sendTime', sendTime)
|
|
||||||
// 超过两秒就算是拉进度了
|
|
||||||
if(sendTime > 2 && this.oldVideoTime !== 0){
|
|
||||||
console.log('开始计时发送sendTime',sendTime);
|
|
||||||
this.$emit('onPlayerSendTime', sendTime)
|
|
||||||
}
|
|
||||||
this.oldVideoTime = this.videoDom.currentTime
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// notePlay: function(val) {
|
// notePlay: function(val) {
|
||||||
// if(val) {
|
// if(val) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<videoPlayer ref="myVideoPlayer" id="myVideoPlayer" :src="blobUrl" @onPlayerPlaying="onPlayerPlaying"
|
<videoPlayer ref="myVideoPlayer" id="myVideoPlayer" :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" @onPlayerSendTime="onPlayerSendTime"></videoPlayer>
|
@onPlayerEnded="onPlayerEnded" :isCrowd="isCrowd"></videoPlayer>
|
||||||
<div class="player-box" v-if="playerBoxShow">
|
<div class="player-box" v-if="playerBoxShow">
|
||||||
<div class="player-praise" style="cursor: pointer;">
|
<div class="player-praise" style="cursor: pointer;">
|
||||||
<div @click="praiseContent">
|
<div @click="praiseContent">
|
||||||
@@ -449,28 +449,6 @@
|
|||||||
this.stopStudyTime();
|
this.stopStudyTime();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onPlayerSendTime(sendTime){
|
|
||||||
console.log(sendTime,'发送的时间');
|
|
||||||
let postData={
|
|
||||||
"key": "StudyCourse",//课程学习的key
|
|
||||||
"title": "学习课程",//事件的标题
|
|
||||||
"parameters":"second:" + Math.floor(sendTime),//second:value 本次的学习时长
|
|
||||||
"content": "学习课程【"+this.courseInfo.name+"】",//事件的内容
|
|
||||||
"objId": this.courseInfo.id,//课程的id
|
|
||||||
"objType": "1",//类型
|
|
||||||
"source":"page",
|
|
||||||
"objInfo": ""+this.courseInfo.name,
|
|
||||||
"aid":this.userInfo.aid, //当前登录人的id
|
|
||||||
"aname":this.userInfo.name,//当前人的姓名
|
|
||||||
"status": 1 //状态
|
|
||||||
}
|
|
||||||
//静默处理
|
|
||||||
apiStat.sendEvent(postData).then(rs=>{
|
|
||||||
if(rs.status != 200) {
|
|
||||||
console.log(rs.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
toUserHome(tea){
|
toUserHome(tea){
|
||||||
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
|
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user