From c9c21fafdb481a4bbb661229f6dc3e2b673ab3c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Feb 2023 10:27:26 +0100 Subject: Fix button link on mobile --- .../src/assets/player/shared/control-bar/peertube-link-button.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'client') diff --git a/client/src/assets/player/shared/control-bar/peertube-link-button.ts b/client/src/assets/player/shared/control-bar/peertube-link-button.ts index a9b432b8c..45d7ac42f 100644 --- a/client/src/assets/player/shared/control-bar/peertube-link-button.ts +++ b/client/src/assets/player/shared/control-bar/peertube-link-button.ts @@ -2,8 +2,8 @@ import videojs from 'video.js' import { buildVideoLink, decorateVideoLink } from '@shared/core-utils' import { PeerTubeLinkButtonOptions } from '../../types' -const Button = videojs.getComponent('Button') -class PeerTubeLinkButton extends Button { +const Component = videojs.getComponent('Component') +class PeerTubeLinkButton extends Component { constructor (player: videojs.Player, options?: PeerTubeLinkButtonOptions) { super(player, options as any) @@ -17,10 +17,6 @@ class PeerTubeLinkButton extends Button { this.el().setAttribute('href', this.buildLink()) } - handleClick () { - this.player().pause() - } - private buildElement () { const el = videojs.dom.createEl('a', { href: this.buildLink(), @@ -31,6 +27,7 @@ class PeerTubeLinkButton extends Button { }) el.addEventListener('mouseenter', () => this.updateHref()) + el.addEventListener('click', () => this.player().pause()) return el as HTMLButtonElement } -- cgit v1.2.3