Custom React Hooks
Programmatic state control with useDriveImage, useDriveVideo, and useDriveAudio.
Overview
Exposes full resolution lifecycle, errors, media controls, and extracted metadata directly to your custom React components.
Code Example
hooks.tsx
| 1 | import { useDriveVideo } from '@driveloader/react'; |
| 2 | |
| 3 | const { videoUrl, loading, error, metadata } = useDriveVideo(url); |
Best Practices
- •Use hooks when you need to build entirely custom UI elements (like a bespoke video player controls bar).
