liushengqiang 2 lat temu
rodzic
commit
df1ecbef9b
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8 2
      src/view/evaluating/index.tsx

+ 8 - 2
src/view/evaluating/index.tsx

@@ -253,6 +253,7 @@ const recordStartTimePoint = async (res?: IPostMessage) => {
 	console.log("🚀 ~ 开始时间点:", evaluatingData.backtime, "已经录的时间:", Date.now() - inteveral, '记录时间点:', Date.now());
 	// 开始播放
 	playMusic();
+
 	// playTestMusic()
 };
 
@@ -262,11 +263,12 @@ const getTestCurrent = () => {
 	console.log("🚀 ~ 播放的时间测试:", _c)
 	if (_c >= 500){
 		console.error('开始播放的延迟:', Date.now() - evaluatingData.backtime - 500)
+		_audio.pause()
 		// 延迟500毫秒播放
 		setTimeout(() => {
 			playMusic()
-		}, 500)
-		_audio.pause()
+		}, 2000)
+		
 		return
 	}
 	setTimeout(() => {
@@ -285,7 +287,11 @@ const playTestMusic = () => {
 	}
 	_audio.onloadedmetadata = () => {
 		console.log('测试音频加载完成')
+		console.log('开始播放的时间点', Date.now())
 		_audio.play();
+		setTimeout(() => {
+			console.log('结束播放的时间点', Date.now(), _audio.currentTime * 1000)
+		}, 500)
 	}
 	_audio.load()
 }