Skip to content

Commit

Permalink
feat: double tap to seek on android
Browse files Browse the repository at this point in the history
  • Loading branch information
NoCrypt committed Aug 8, 2024
1 parent a9a0851 commit 7e8d470
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions common/views/Player/Player.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,14 @@
function toggleFullscreen () {
document.fullscreenElement ? document.exitFullscreen() : document.querySelector('.content-wrapper').requestFullscreen()
}
function executeSeek(event){
console.log(event)
const rect = event.target.getBoundingClientRect();
seek( (event.clientX - rect.left) < rect.width / 2 ? -$settings.playerSeek : $settings.playerSeek );
immersePlayer();
}
function skip () {
const current = findChapter(currentTime)
if (current) {
Expand Down Expand Up @@ -1119,9 +1127,9 @@
</div>
<div class='middle d-flex align-items-center justify-content-center flex-grow-1 position-relative'>
<!-- eslint-disable-next-line svelte/valid-compile -->
<div class='w-full h-full position-absolute toggle-fullscreen' on:dblclick={toggleFullscreen} on:click|self={() => { if (page === 'player') playPause(); page = 'player' }} />
<div class='w-full h-full position-absolute toggle-fullscreen' on:dblclick={!SUPPORTS.isAndroid ? toggleFullscreen : executeSeek} on:click|self={() => { if (page === 'player') playPause(); page = 'player' }} />
<!-- eslint-disable-next-line svelte/valid-compile -->
<div class='w-full h-full position-absolute toggle-immerse d-none' on:dblclick={toggleFullscreen} on:click|self={toggleImmerse} />
<div class='w-full h-full position-absolute toggle-immerse d-none' on:dblclick={!SUPPORTS.isAndroid ? toggleFullscreen : executeSeek} on:click|self={toggleImmerse} />
<div class='w-full h-full position-absolute mobile-focus-target d-none' use:click={() => { page = 'player'; toggleFullscreen() }} />
<!-- eslint-disable-next-line svelte/valid-compile -->
<span class='material-symbols-outlined ctrl h-full align-items-center justify-content-end w-150 mw-full mr-auto' on:click={rewind}> fast_rewind </span>
Expand Down

0 comments on commit 7e8d470

Please sign in to comment.