# m3u8cloner

> Clone m3u8 streams and get chunks from local

Latest version **1.0.91** (published 2020-07-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install m3u8cloner
pnpm add m3u8cloner
yarn add m3u8cloner
bun add m3u8cloner
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.91 |
| Published | 2020-07-14 |
| First published | 2020-06-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | elgiz |
| Maintainers | liyamsi |

## Links

- npm: https://www.npmjs.com/package/m3u8cloner
- npm.io page: https://npm.io/package/m3u8cloner

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.19.2
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.4

## Recent versions

- 1.0.91 (latest) — 2020-07-14
- 1.0.9 — 2020-06-29
- 1.0.8 — 2020-06-27
- 1.0.7 — 2020-06-27
- 1.0.6 — 2020-06-27
- 1.0.5 — 2020-06-26
- 1.0.4 — 2020-06-26
- 1.0.3 — 2020-06-19
- 1.0.2 — 2020-06-19
- 1.0.1 — 2020-06-19
- 1.0.0 — 2020-06-13

## README

## Usage

Minimum nodejs version must be 12.0.0

### Creeate Instance

```
let HlsCloner = require("m3u8cloner")
let path = require("path");

let hls = new HlsCloner({
    url:"https://<url>.m3u8",
    tempFolder: path.join(__dirname, "tmp")
});
```

### Use Middleware

```
let app = require("express")();

app.use("/player", hls.middleware);

app.listen(3000);
```

### Client Side

index.html

```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
    <video id="video"></video>
    <script>
        var video = document.getElementById('video');
        var videoSrc = 'player/main.m3u8';
        if (Hls.isSupported()) {
            var hls = new Hls();
            hls.loadSource(videoSrc);
            hls.attachMedia(video);
            hls.on(Hls.Events.MANIFEST_PARSED, function () {
                video.play();
            });
        }
        else if (video.canPlayType('application/vnd.apple.mpegurl')) {
            video.src = videoSrc;
            video.addEventListener('loadedmetadata', function () {
                video.play();
            });
        }
    </script>
</body>
</html>
```

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