|
@@ -529,7 +529,13 @@ const handlePlaying = () => {
|
|
|
const selectStartItem = state.sectionFirst ? state.sectionFirst : state.section[0];
|
|
|
const selectEndItem = state.section[1];
|
|
|
// 如果选段播放结束,或者音频播放结束(判断条件:currentTime >= duration)
|
|
|
- if ( (currentTime - selectEndItem.endtime >= 0) || (currentTime >= duration) ) {
|
|
|
+ // console.log('时间',currentTime,duration)
|
|
|
+ /**
|
|
|
+ * TODO:兼容音频时长比xml时值短的曲子
|
|
|
+ * isAudioShort:音频比选段的xml时值短,部分手机最后一帧返回的currentTime会比duration小,在这里加上一帧的时间(0.1666~0.2)
|
|
|
+ */
|
|
|
+ const isAudioShort = duration < selectEndItem.endtime
|
|
|
+ if ( (currentTime - selectEndItem.endtime >= 0) || (isAudioShort && (currentTime+0.02 >= duration)) ) {
|
|
|
console.log("选段播放结束", state.setting.repeatAutoPlay);
|
|
|
// 如果为选段评测模式
|
|
|
if (state.modeType === "evaluating" && state.isSelectMeasureMode) {
|