# use-video-previewer

> ![Demo Gif](demo.gif)

Latest version **1.0.4** (published 2023-08-02) · 0 weekly downloads

## Install

```sh
npm install use-video-previewer
pnpm add use-video-previewer
yarn add use-video-previewer
bun add use-video-previewer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-08-02 |
| First published | 2023-08-01 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 22.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nurullah Kılıç |
| Maintainers | nurullahkilic |
| Keywords | react, typescript, awesome-project |

## Links

- npm: https://www.npmjs.com/package/use-video-previewer
- Repository: https://github.com/nurullahkilic/use-video-previewer
- Homepage: https://github.com/nurullahkilic/use-video-previewer#readme
- Issues: https://github.com/nurullahkilic/use-video-previewer/issues
- npm.io page: https://npm.io/package/use-video-previewer

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.6.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2023-08-02
- 1.0.3 — 2023-08-01
- 1.0.2 — 2023-08-01
- 1.0.1 — 2023-08-01
- 1.0.0 — 2023-08-01

## README

# Video Previewer for VOD Project

![Demo Gif](demo.gif)

The `use-video-previewer` is a custom hook designed to facilitate fast and efficient previsualization of video content in Video on Demand (VOD) projects similar to Netflix, Prime Video and Tabii. This hook provides an easy-to-use interface for fetching and displaying video previews for different video formats such as HLS, Dash, and mp4.

## Features
- Fetch and display video previews for various video formats (HLS, Dash, mp4, etc.).
- Effortless integration with React projects using custom hooks.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Available Hooks](#available-hooks)
- [License](#license)

## Installation

To use the `use-video-previewer` package in your project, you can install it via npm or yarn:

```bash
npm install use-video-previewer
```

or

```bash
yarn add use-video-previewer
```

## Usage

After installation, you can import and use the hooks in your React components:

```jsx
import React from 'react';
import { useVideoPreviewer } from "use-video-previewer";

function MyComponent() {
  const [PreviewComponent, videoElement] = useVideoPreviewer({
    isMuted: false,
    mediaUri: "https://dash.akamaized.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd",
    debounce: 1200,
  });

  return (
    <>
      <div
        style={{
          width: "380px",
          height: "420px",
          background: "red",
          position: "relative",
          marginBottom:"20px"
        }}
      >
        {PreviewComponent}
      </div>

      <button onClick={() => videoElement?.play()}>Play</button>
      <button onClick={() => videoElement?.pause()}>Pause</button>
    </>
  );
}
```
## License

This project is licensed under the [MIT License](LICENSE). You are free to use, modify, and distribute this code as permitted by the license. See the [LICENSE](LICENSE) file for more details.

---
_Source: https://npm.io/package/use-video-previewer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
