Skip to content

ReferenceGestures

useTapGesture

Hook that registers a tap gesture for the current Player

Import

import { useTapGesture } from "@videojs/react";

Usage

Call the hook inside Player. It listens on the current player container unless target supplies another element.

function TapFeedback() {
  useTapGesture(() => console.log("Tap"), { region: "center" });

  return null;
}

Use pointer, region, and disabled to control recognition. Supplying target does not make the hook safe outside Player, because it still reads the player container context.

API Reference

useTapGesture(onActivate, options?): void

Parameters

ParameterTypeDefaultDetails
onActivate*function—
optionsobject—

Return Value

void