#31 : Use step ms instead of steps count
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { setIntervalImmediate } from './interval'
|
import { setIntervalImmediate } from './interval'
|
||||||
|
|
||||||
const PROGRESS_STEPS_COUNT = 100
|
const STEP_MS = 35
|
||||||
|
|
||||||
export class ProgressManager {
|
export class ProgressManager {
|
||||||
#autoplayDuration
|
#autoplayDuration
|
||||||
#onProgressValueChange
|
#onProgressValueChange
|
||||||
@@ -20,7 +19,7 @@ export class ProgressManager {
|
|||||||
start(onFinish) {
|
start(onFinish) {
|
||||||
this.reset()
|
this.reset()
|
||||||
|
|
||||||
const stepMs = this.#autoplayDuration / PROGRESS_STEPS_COUNT
|
const stepMs = Math.min(STEP_MS, this.#autoplayDuration)
|
||||||
let progress = -stepMs
|
let progress = -stepMs
|
||||||
|
|
||||||
this.#interval = setIntervalImmediate(() => {
|
this.#interval = setIntervalImmediate(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user