minor crash in audio and a couple of typos

This commit is contained in:
or-else
2022-05-10 21:13:42 -07:00
parent a4d765da14
commit f9a563248b
7 changed files with 4221 additions and 6313 deletions
+3 -3
View File
@@ -96,7 +96,7 @@ export default class AudioPlayer extends React.PureComponent {
}
initCanvas() {
// Force canvas aspect ration to match one of the element + upscale canvas to reduce blurring.
// Force canvas aspect ratio to match one of the element + upscale canvas to reduce blurring.
this.canvasRef.current.width = this.canvasRef.current.offsetWidth * CANVAS_UPSCALING;
this.canvasRef.current.height = this.canvasRef.current.offsetHeight * CANVAS_UPSCALING;
@@ -119,7 +119,7 @@ export default class AudioPlayer extends React.PureComponent {
this.canvasContext.lineWidth = LINE_WIDTH;
const drawFrame = () => {
if (!this.canvasRef.current) {
if (!this.canvasRef.current || !this.audioPlayer) {
// The component is unmounted.
return;
}
@@ -131,7 +131,7 @@ export default class AudioPlayer extends React.PureComponent {
window.requestAnimationFrame(drawFrame);
}
// Current pplayback position.
// Current playback position.
const thumbAt = this.props.duration ?
Math.max(0, Math.min(this.audioPlayer.currentTime * 1000 / this.props.duration, 1)) * (width - LINE_WIDTH * 2) : -1;
+1 -1
View File
@@ -9952,7 +9952,7 @@ class AudioPlayer extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp
this.canvasContext.lineWidth = LINE_WIDTH;
const drawFrame = () => {
if (!this.canvasRef.current) {
if (!this.canvasRef.current || !this.audioPlayer) {
return;
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4213 -6305
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long