Skip to content

Commit

Permalink
judes suggested changes to audio
Browse files Browse the repository at this point in the history
  • Loading branch information
pathnirvana committed Aug 6, 2024
1 parent 69e14c0 commit 2191e52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/AudioControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

</template>

<v-btn icon @click="navigateToActive"><v-icon>mdi-sync</v-icon></v-btn>
<v-btn icon @click="navigateToActive"><v-icon>mdi-chevron-double-up</v-icon></v-btn>
<v-menu offset-y top>
<template v-slot:activator="{ on, attrs }">
<v-btn icon v-on="on" v-bind="attrs">
Expand All @@ -24,8 +24,8 @@
<v-list-item>
<v-list-item-icon><v-icon>mdi-play-speed</v-icon></v-list-item-icon>
<v-list-item-content>
<v-slider v-model="rate" :step="0.05" :min="0.75" :max="1.25"
persistent-hint :hint="`සජ්ඣායනා වේගය ${Math.round(rate * 100) - 100}%`" style="width: 150px">
<v-slider v-model="rate" :step="0.05" :min="0.75" :max="2"
persistent-hint :hint="`සජ්ඣායනා වේගය ${rate}x`" style="width: 150px">
</v-slider>
</v-list-item-content>
</v-list-item>
Expand Down Expand Up @@ -53,7 +53,7 @@
<v-icon v-else>mdi-play</v-icon>
</v-btn>
<v-btn icon @click="$store.dispatch('audio/moveParagraph', 1)"><v-icon>mdi-fast-forward</v-icon></v-btn>
<v-btn icon @click="showAudio = false" color="error">
<v-btn icon @click="showAudio = false, $store.commit('audio/pauseAudio')" color="error">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-toolbar>
Expand Down
4 changes: 4 additions & 0 deletions src/store/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export default {
audio.play()
}
},
pauseAudio(state) {
if (!audio.src) return
audio.pause();
},
setPlaybackRate(state, playbackRate) {
state.playbackRate = audio.playbackRate = playbackRate
},
Expand Down

0 comments on commit 2191e52

Please sign in to comment.