Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/renderer/components/WatchVideoInfo/WatchVideoInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@
:get-timestamp="getTimestamp"
:playlist-id="playlistId"
/>
<FtIconButton
:title="t('Video.Reload Page')"
:icon="['fas', 'sync']"
theme="secondary"
@click="reloadPlayer"
/>
</span>
</div>
</div>
Expand Down Expand Up @@ -241,6 +247,7 @@ const emit = defineEmits([
'change-format',
'pause-player',
'save-watched-progress',
'reload-player',
])

const USING_ELECTRON = process.env.IS_ELECTRON
Expand Down Expand Up @@ -317,6 +324,10 @@ function changeFormat(value) {
emit('change-format', value)
}

function reloadPlayer() {
emit('reload-player')
}

const watchedProgressSavingInSemiAutoMode = computed(() => {
return store.getters.getWatchedProgressSavingMode === 'semi-auto'
})
Expand Down
17 changes: 13 additions & 4 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import {
extractNumberFromString,
formatDurationAsTimestamp,
formatNumber,
showToast
showToast,
throttle
} from '../../helpers/utils'
import {
getLocalVideoInfo,
Expand Down Expand Up @@ -1972,9 +1973,7 @@ export default defineComponent({
this.startNextVideoInPip = uiState.startNextVideoInPip
},

async onPlayerReloadRequested() {
showToast('Reloading player according to SABR request')

async saveWatchProgressForReload() {
Comment thread
Shadorc marked this conversation as resolved.
const timestamp = this.getTimestamp()
if (timestamp > 0) {
// Reload at the middle should restart at current timestamp
Expand All @@ -1991,6 +1990,16 @@ export default defineComponent({
}
}
}
},

onManualReloadRequested: throttle(async function () {
Comment thread
Shadorc marked this conversation as resolved.
await this.saveWatchProgressForReload()
await this.reloadView()
}, 1000),

async onSabrReloadRequested() {
showToast('Reloading player according to SABR request')
await this.saveWatchProgressForReload()
await this.reloadView()
},

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/views/Watch/Watch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
@playback-rate-updated="updatePlaybackRate"
@skip-to-next="handleSkipToNext"
@skip-to-prev="handleSkipToPrev"
@player-reload-requested="onPlayerReloadRequested"
@player-reload-requested="onSabrReloadRequested"
/>
<div
v-if="!isLoading && (isUpcoming || errorMessage)"
Expand Down Expand Up @@ -157,6 +157,7 @@
@change-format="handleFormatChange"
@pause-player="pausePlayer"
@save-watched-progress="handleWatchProgressManualSave"
@reload-player="onManualReloadRequested"
/>
<watch-video-chapters
v-if="!hideChapters && !isLoading && videoChapters.length > 0"
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ Video:
Published on: Published on
Streamed on: Streamed on
Started streaming on: Started streaming on
Reload Page: Reload Page
DeArrow:
Show Original Details: Show Original Details
Show Modified Details: Show Modified Details
Expand Down