Skip to content

Commit

Permalink
More fix for linux & bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
tranxuanthang committed Oct 4, 2023
1 parent 2d69eda commit 4cc0e53
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "LRCGET",
"version": "0.2.0"
"version": "0.2.1"
},
"tauri": {
"allowlist": {
Expand Down
32 changes: 28 additions & 4 deletions src/composables/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ export function usePlayer() {
howlerSound.value.seek(setProgress)

status.value = 'playing'
window.requestAnimationFrame(updater)

if (platformName === 'linux') {
updater2()
} else {
window.requestAnimationFrame(updater)
}
})

howlerSound.value.on('pause', () => {
Expand All @@ -71,20 +76,39 @@ export function usePlayer() {
}

const updater = (timestamp) => {
if (!howlerSound.value || status.value !== 'playing') {
if (status.value !== 'playing') {
return
}

if (howlerSound.value.seek() > 0.0) {
progress.value = howlerSound.value.seek()
const currentProgress = howlerSound.value.seek()

if (currentProgress > 0.0) {
progress.value = currentProgress
}

window.requestAnimationFrame(updater)
}

const updater2 = () => {
if (status.value !== 'playing') {
return
}

const currentProgress = howlerSound.value.seek()

if (currentProgress > 0.0) {
progress.value = currentProgress
}

setTimeout(() => {
updater2()
}, 70)
}

const pause = () => {
howlerSound.value.unload()
Howler.unload()
status.value = 'paused'
}

const resume = () => {
Expand Down

0 comments on commit 4cc0e53

Please sign in to comment.