Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setProgress(progress) {
if (typeof progress !== 'number') {
throw new Error(
`progress must be a number, got a ${typeof progress} instead`
)
}
this.setSeek(clamp(progress, 0, 1) * this.duration)
}
}
setRate(rate) {
if (typeof rate !== 'number') {
throw new Error(`rate must be a number, got a ${typeof rate} instead`)
}
this.$data._howl.rate(clamp(rate, 0.5, 4))
},
/**
setSeek(seek) {
if (typeof seek !== 'number') {
throw new Error(`seek must be a number, got a ${typeof seek} instead`)
}
this.$data._howl.seek(clamp(seek, 0, this.duration))
},
/**
setVolume(volume) {
if (typeof volume !== 'number') {
throw new Error(
`volume must be a number, got a ${typeof volume} instead`
)
}
this.$data._howl.volume(clamp(volume, 0, 1))
},
/**