Skip to content

Commit

Permalink
keep controls visible if they're being hovered on
Browse files Browse the repository at this point in the history
  • Loading branch information
GizmoTjaz committed Oct 1, 2021
1 parent 531c179 commit 68ea65b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/Video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
<transition name="fade">
<div
v-show="isMouseInOverlay && !isMouseStatic"
v-show="isMouseInOverlay && !isMouseStatic || isHoveringOverControls"
class="hover-overlay"
>
<div class="time-row">
Expand All @@ -52,7 +52,11 @@
<span>{{ formattedDuration }}</span>
</div>
<div class="control-row">
<div class="control-row-left">
<div
class="control-row-left"
@mouseenter="isHoveringOverControls = true"
@mouseleave="isHoveringOverControls = false"
>
<div v-if="controls" @click="togglePlayPause">
<Play v-if="isPaused" />
<Pause v-else />
Expand Down Expand Up @@ -80,7 +84,11 @@
</transition>
</div>
</div>
<div class="control-row-right">
<div
class="control-row-right"
@mouseenter="isHoveringOverControls = true"
@mouseleave="isHoveringOverControls = false"
>
<ClosedCaptioning class="subtitle-button" @click="isSubtitleTrayVisible = !isSubtitleTrayVisible" />
<transition name="video-tray">
<div
Expand Down Expand Up @@ -257,6 +265,7 @@
isBusy: false,
isMouseInOverlay: false,
isMouseStatic: false,
isHoveringOverControls: false,
lastMousePosition: [ 0, 0 ] as [ number, number ],
mouseChecker: 0,
lastClickTimestamp: 0
Expand Down

0 comments on commit 68ea65b

Please sign in to comment.