Skip to content

Commit

Permalink
fixed audio player for safari
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRoehm committed Apr 7, 2023
1 parent de3fc02 commit 8ac5635
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/AudioPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ export default defineComponent({
playbackRate.value = rates[(index + 1) % (rates.length)]
audio.value.playbackRate = playbackRate.value
}
function _handleLoaded() {
if (!loaded.value && audio.value.readyState >= 2 || preload.value == null) {
function _handleLoaded(e) {
console.log(e)
console.log(audio.value.readyState)
if (!loaded.value && audio.value.readyState >= 1 || preload.value == null) {
if (props.autoPlay) this.play();
loaded.value = true;
totalDuration.value = audio.value.duration;
Expand Down

0 comments on commit 8ac5635

Please sign in to comment.