Types

Gestures Types

Types related to player gestures including double-tap, pan gestures, and gesture handler interfaces.

UseDoubleTapGestureProps

The UseDoubleTapGestureProps interface defines the props for the useDoubleTapGesture hook.

PropertyTypeRequiredDefaultDescription
videoRefReact.RefObject<any>YesnullA ref to the video player component.
doubleTapSeekIntervalnumberNo10The number of seconds to seek forward or backward on double-tap.
onDoubleTapSeekStart() => voidNoundefinedA callback function that is called when a double-tap seek starts.
onDoubleTapSeekEnd() => voidNoundefinedA callback function that is called when a double-tap seek ends.

UsePanGestureProps

The UsePanGestureProps interface defines the props for the usePanGesture hook.

PropertyTypeRequiredDefaultDescription
onLeftVerticalPan(e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => voidNoundefinedA callback function that is called when a vertical pan gesture is detected on the left side of the screen.
onRightVerticalPan(e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => voidNoundefinedA callback function that is called when a vertical pan gesture is detected on the right side of the screen.
onGlobalVerticalPan(e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => voidNoundefinedA callback function that is called when a vertical pan gesture is detected anywhere on the screen.

If you use the onGlobalVerticalPan prop, it will override the onLeftVerticalPan and onRightVerticalPan props. You should use either the global pan handler or the side-specific pan handlers, but not both.

UseSingleTapGestureProps

The UseSingleTapGestureProps interface defines the props for the useSingleTapGesture hook.

PropertyTypeRequiredDefaultDescription
onSingleTap(e: GestureStateChangeEvent<TapGestureHandlerEventPayload>) => voidNoundefinedA callback function that is called when a single tap gesture is performed anywhere on the screen.

UseLongPressGestureProps

The UseLongPressGestureProps interface defines the props for the useLongPressGesture hook.

PropertyTypeRequiredDefaultDescription
onLongPressStart(e: GestureTouchEvent) => voidNoundefinedA callback function that is called when a long press gesture starts.
onLongPressEnd(e: GestureStateChangeEvent<TapGestureHandlerEventPayload>) => voidNoundefinedA callback function that is called when a long press gesture ends.

GestureHandlerProps

The GestureHandlerProps interface defines the props for the GestureHandler component. It extends UseDoubleTapGestureProps, UsePanGestureProps, UseSingleTapGestureProps, and UseLongPressGestureProps.

PropertyTypeRequiredDefaultDescription
childrenReact.ReactNodeNoThe children of the component.