Skip to content

Commit

Permalink
Merge pull request #150 from tillvit/development
Browse files Browse the repository at this point in the history
Fix time returning nothing when sound not loaded
  • Loading branch information
tillvit authored Nov 4, 2024
2 parents 87946ff + 09f8011 commit 2718370
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/src/chart/ChartManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ export class ChartManager {
}

playPause() {
this.setNoteIndex()
if (this.chartAudio.isPlaying()) this.chartAudio.pause()
else this.chartAudio.play()
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/chart/audio/ChartAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ export class ChartAudio {
seek(): number
seek(playbackTime: number): void
seek(playbackTime?: number) {
if (this._destroyed) return
if (!this._source) return
if (this._destroyed) return 0
if (!this._source) return 0
if (playbackTime === undefined) {
if (!this._isPlaying) return this._playbackTime
return (
Expand Down

0 comments on commit 2718370

Please sign in to comment.