Skip to content

Commit

Permalink
Add an EReader setting for turning when playing
Browse files Browse the repository at this point in the history
This allows to allow the navigation with the Volume buttons even when
audiobooks are playing.
  • Loading branch information
RaHoni committed Nov 17, 2024
1 parent ad7ca59 commit 12a3969
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
25 changes: 22 additions & 3 deletions components/readers/Reader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</modals-fullscreen-modal>

<!-- ereader settings modal -->
<modals-fullscreen-modal v-model="showSettingsModal" :theme="ereaderTheme" half-screen>
<modals-fullscreen-modal v-model="showSettingsModal" :theme="ereaderTheme">
<div style="box-shadow: 0px -8px 8px #11111155">
<div class="flex items-end justify-between h-14 px-4 pb-2 mb-6">
<h1 class="text-lg">{{ $strings.HeaderEreaderSettings }}</h1>
Expand Down Expand Up @@ -100,6 +100,12 @@
</div>
<ui-toggle-btns v-model="ereaderSettings.navigateWithVolume" :items="navigateWithVolumeItems" @input="settingsUpdated" />
</div>
<div class="flex items-center">
<div class="w-32">
<p class="text-base">{{ $strings.LabelNavigateWithVolumeWhilePlaying}}:</p>
</div>
<ui-toggle-btns v-model="ereaderSettings.navigateWithVolumeWhilePlaying" :items="navigateWithVolumeWhilePlayingItems" @input="settingsUpdated" />
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -132,7 +138,8 @@ export default {
lineSpacing: 115,
spread: 'auto',
textStroke: 0,
navigateWithVolume: 'enabled'
navigateWithVolume: 'enabled',
navigateWithVolumeWhilePlaying: false
}
}
},
Expand Down Expand Up @@ -209,6 +216,18 @@ export default {
}
]
},
navigateWithVolumeWhilePlayingItems() {
return [
{
text: this.$strings.LabelNavigateWithVolumeWhilePlayingEnabled,
value: true
},
{
text: this.$strings.LabelNavigateWithVolumeWhilePlayingDisabled,
value: false
}
]
},
themeItems() {
return [
{
Expand Down Expand Up @@ -424,7 +443,7 @@ export default {
this.isInittingWatchVolume = true
const isWatching = await VolumeButtons.isWatching()
if (this.ereaderSettings.navigateWithVolume !== 'none' && !this.isPlayerOpen) {
if (this.ereaderSettings.navigateWithVolume !== 'none' && (this.ereaderSettings.navigateWithVolumeWhilePlaying || !this.isPlayerOpen)) {
if (!isWatching.value) {
const options = {
disableSystemVolumeHandler: true,
Expand Down
3 changes: 3 additions & 0 deletions strings/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@
"LabelNavigateWithVolumeDisabled": "Aus",
"LabelNavigateWithVolumeEnabled": "An",
"LabelNavigateWithVolumeMirrored": "Umgekehrt",
"LabelNavigateWithVolumeWhilePlaying": "Auch bei Wiedergabe blättern",
"LabelNavigateWithVolumeWhilePlayingDisabled": "Aus",
"LabelNavigateWithVolumeWhilePlayingEnabled": "An",
"LabelNever": "Nie",
"LabelNewestAuthors": "Neueste Autoren",
"LabelNewestEpisodes": "Neueste Episoden",
Expand Down
3 changes: 3 additions & 0 deletions strings/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@
"LabelNavigateWithVolumeDisabled": "Off",
"LabelNavigateWithVolumeEnabled": "On",
"LabelNavigateWithVolumeMirrored": "Mirrored",
"LabelNavigateWithVolumeWhilePlaying": "Also Navigate while playing",
"LabelNavigateWithVolumeWhilePlayingDisabled": "Off",
"LabelNavigateWithVolumeWhilePlayingEnabled": "On",
"LabelNever": "Never",
"LabelNewestAuthors": "Newest Authors",
"LabelNewestEpisodes": "Newest Episodes",
Expand Down

0 comments on commit 12a3969

Please sign in to comment.