liujiaxin 2 weeks ago
parent
commit
f5aed772f2
1 changed files with 4 additions and 24 deletions
  1. 4 24
      pages_course/living.vue

+ 4 - 24
pages_course/living.vue

@@ -848,17 +848,9 @@
 			},
 			// 缓冲
 			getInternetTraffic() {
-				console.log("流量>>>>")
-				// if(!this.liveId) return
-				// const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
-				// if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
-				// 	this.bufferRate = playVideoTime
-				// }
-				// if(this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
-
+				if (!this.liveItem.videoId ||!this.liveItem.videoType) return;
+				if (!this.liveId) return;
 				const currentTime = this.stayTime / this.liveItem.duration * 100;
-				console.log("currentTime是什么", currentTime)
-
 				const param = {
 					companyId: this.companyId || '',
 					companyUserId: this.companyUserId || '',
@@ -866,23 +858,11 @@
 					liveId: this.liveId || '',
 					videoType: this.liveItem.videoType,
 					videoId: this.liveItem.videoId,
-
 					uuId: dayjs().format('YYYYMMDD') + this.uuId,
 					duration: this.liveItem.duration,
 					bufferRate: currentTime,
 				}
-				// if(!param.bufferRate) return
-				// internetTraffic(param)
-				console.log("流量1>>>>")
-				internetTraffic(param).then(res => {
-					if (res.code == 200) {
-						console.log("流量成功>>>>", res)
-
-					}
-				}).catch(error => {
-					console.error("流量失败:", error);
-
-				});
+				internetTraffic(param)
 			},
 			scrollToBottom() {
 				this.$nextTick(() => {
@@ -1918,7 +1898,7 @@
 					}
 					this.trafficInterval = setInterval(function() {
 						that.getInternetTraffic()
-					}, 5000);
+					},60000);
 
 					this.$set(this.liveItem, 'autoplay', res.data.liveType !== 0);
 					this.$set(this.liveItem, 'showType', res.data.showType);