Module useVideoGallery

Custom hook for managing the Swiper video thumbnail gallery logic in the VideoGallery component. Provides Swiper options and keyboard navigation using left/right arrow keys.

  • Supports dynamic Swiper breakpoints using the Material UI theme.
  • Enables keyboard navigation (left/right arrows) through video thumbnails.
  • Automatically syncs the visible slide with the current index when navigating.

The currently active video index.

Total number of videos in the gallery.

Callback to update the active video index.

Swiper configuration and a ref to the Swiper instance.

const { thumbSwiperRef, thumbSwiperOptions } = useVideoGallery(
currentIndex,
videos.length,
setCurrentIndex
);

Functions

useVideoGallery