Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PlayPauseButton): conflict with spacebar in fullscreen video #2383

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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
9 changes: 8 additions & 1 deletion frontend/src/components/Buttons/Playback/PlayPauseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
icon
:size="size"
:loading="playbackManager.isBuffering"
@click="playbackManager.playPause">
@click="(e: MouseEvent) => {
if ('pointerType' in e && e.pointerType) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.keyCode != 32 might be a better fix - this solution breaks touch input on the button (I wouldn’t have noticed but happened to be testing via an iPad!).

More on this situation which I am only just learning about: http://www.quirksmode.org/dom/events/click.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also ran the tests in Microsoft Edge on a Surface, where that property's value was "touch". So I assume in Chromium that property changes between "mouse", "touch" and "" when it's not pointer based, but in Safari that property doesn't exist whatsoever? Funky differences between browsers strikes again

I don't recall seeing keyCode in the payload of that event (in Chromium) either, but I need to check again. If it doesn't exist, I think that the only cross browser solution would be to focus the button as I mentioned in the issue.

But we can't do that now because the underlying ref is not exposed by Vuetify (and using querySelector is not a good solution). Would you like contributing in creating a JBtn component that has the same implementation as Vuetify but in SFC?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manicExpressive I can confirm you now that keyCode doesn't exist in Chromium-based browsers.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I think I'm tracking with you now that I've poked around on my (Ubuntu / Chrome / Firefox) desktop a bit.

I don't have capacity in the near term to contribute much, but I'll circle back and check-in when my schedule opens up a bit.

playbackManager.playPause()
}
}">
<VIcon
:size="size"
:icon="playPauseIcon" />
</VBtn>
</template>

<script setup lang="ts">
/**
* - Reason behind pointer checks: https://github.com/jellyfin/jellyfin-vue/issues/2353
*/
import IMdiExclamation from 'virtual:icons/mdi/exclamation';
import IMdiPauseCircleOutline from 'virtual:icons/mdi/pause-circle-outline';
import IMdiPlayCircleOutline from 'virtual:icons/mdi/play-circle-outline';
Expand Down
Loading