Closed jakemmarsh closed 5 years ago
In this case it's best not to do look ahead (for / 0 type errors), just use fail-fast exception handling. try{ _this.progress = e.currentTarget.seekable.end( 0 ) / e.currentTarget.duration; } catch (e) { _this.progress = 1; } This is a better implementation ;)
Add a check to first verify that the current audio is seekable before attempting to call
seekable.end(0)
. Fixes this error:Also adds a check to ensure that we only call
createMediaElementSource
if we don't already have a source, preventing theinvalid HTMLMediaElement
error.