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.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
videoRef | React.RefObject<any> | Yes | null | A ref to the video player component. |
doubleTapSeekInterval | number | No | 10 | The number of seconds to seek forward or backward on double-tap. |
onDoubleTapSeekStart | () => void | No | undefined | A callback function that is called when a double-tap seek starts. |
onDoubleTapSeekEnd | () => void | No | undefined | A callback function that is called when a double-tap seek ends. |
UsePanGestureProps
The UsePanGestureProps interface defines the props for the usePanGesture hook.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
onLeftVerticalPan | (e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => void | No | undefined | A callback function that is called when a vertical pan gesture is detected on the left side of the screen. |
onRightVerticalPan | (e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => void | No | undefined | A callback function that is called when a vertical pan gesture is detected on the right side of the screen. |
onGlobalVerticalPan | (e: GestureUpdateEvent<PanGestureHandlerEventPayload>) => void | No | undefined | A 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.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
onSingleTap | (e: GestureStateChangeEvent<TapGestureHandlerEventPayload>) => void | No | undefined | A 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.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
onLongPressStart | (e: GestureTouchEvent) => void | No | undefined | A callback function that is called when a long press gesture starts. |
onLongPressEnd | (e: GestureStateChangeEvent<TapGestureHandlerEventPayload>) => void | No | undefined | A 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.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
children | React.ReactNode | No | – | The children of the component. |