|
@@ -113,6 +113,10 @@ export function destroySmoothAnimation() {
|
|
* 根据播放时间进度移动处理
|
|
* 根据播放时间进度移动处理
|
|
*/
|
|
*/
|
|
export function moveSmoothAnimationByPlayTime() {
|
|
export function moveSmoothAnimationByPlayTime() {
|
|
|
|
+ // 暂停之后不进行移动了
|
|
|
|
+ if (state.playState === "paused") {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const currentTime = getAudioCurrentTime()
|
|
const currentTime = getAudioCurrentTime()
|
|
if (currentTime <= state.fixtime) return
|
|
if (currentTime <= state.fixtime) return
|
|
if (currentTime > state.times.last()?.endtime) return
|
|
if (currentTime > state.times.last()?.endtime) return
|
|
@@ -172,7 +176,7 @@ export function moveSmoothAnimation(progress: number, activeIndex: number) {
|
|
)
|
|
)
|
|
// 当移动到屏幕最右边时候 就不进行移动了
|
|
// 当移动到屏幕最右边时候 就不进行移动了
|
|
if (
|
|
if (
|
|
- (smoothAnimationState.osdmScrollDom?.scrollLeft || 0) + smoothAnimationState.translateXNum + smoothAnimationState.osdmScrollDomWith >
|
|
|
|
|
|
+ (smoothAnimationState.osdmScrollDom?.scrollLeft || 0) + smoothAnimationState.translateXNum + smoothAnimationState.osdmScrollDomWith >=
|
|
smoothAnimationState.canvasDomWith
|
|
smoothAnimationState.canvasDomWith
|
|
) {
|
|
) {
|
|
return
|
|
return
|
|
@@ -231,6 +235,12 @@ function move_osmd(nowPointsPos: pointsPosType[0]) {
|
|
} else if (midBotNum > clientMidWidth + clientWidth * 0.45 && midBotNum <= clientMidWidth + clientWidth * 0.5) {
|
|
} else if (midBotNum > clientMidWidth + clientWidth * 0.45 && midBotNum <= clientMidWidth + clientWidth * 0.5) {
|
|
smoothAnimationState.translateXNum += speed * 5
|
|
smoothAnimationState.translateXNum += speed * 5
|
|
}
|
|
}
|
|
|
|
+ // 最多移动的位置
|
|
|
|
+ const maxTranslateXNum =
|
|
|
|
+ smoothAnimationState.canvasDomWith - smoothAnimationState.osdmScrollDomWith - (smoothAnimationState.osdmScrollDom?.scrollLeft || 0)
|
|
|
|
+ if (smoothAnimationState.translateXNum > maxTranslateXNum) {
|
|
|
|
+ smoothAnimationState.translateXNum = maxTranslateXNum
|
|
|
|
+ }
|
|
moveTranslateXNum(smoothAnimationState.translateXNum)
|
|
moveTranslateXNum(smoothAnimationState.translateXNum)
|
|
}
|
|
}
|
|
|
|
|