# @mistweaverco/hls.js-light

> JavaScript HLS client using MediaSourceExtension

Latest version **1.1.4** (published 2024-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mistweaverco/hls.js-light
pnpm add @mistweaverco/hls.js-light
yarn add @mistweaverco/hls.js-light
bun add @mistweaverco/hls.js-light
```

## 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.1.4 |
| Published | 2024-02-28 |
| First published | 2023-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | walialu |

## Links

- npm: https://www.npmjs.com/package/@mistweaverco/hls.js-light
- Repository: https://github.com/mistweaverco/hls.js-light
- Homepage: https://hlsjs-light.mwco.io
- Issues: https://github.com/mistweaverco/hls.js-light/issues
- npm.io page: https://npm.io/package/@mistweaverco/hls.js-light

## Recent versions

- 1.1.4 (latest) — 2024-02-28
- 1.1.3 — 2024-02-19
- 1.1.2 — 2024-02-14
- 1.1.1 — 2024-02-07
- 1.1.0 — 2024-02-05
- 1.0.4 — 2023-12-21
- 1.0.3 — 2023-12-11
- 1.0.2 — 2023-12-11
- 1.0.1 — 2023-09-20
- 1.0.0 — 2023-09-20
- 0.0.3 — 2023-09-20
- 0.0.2 — 2023-09-20
- 0.0.1 — 2023-09-20

## README

hls.js light
============

This is just the [light flavour] of [hls.js] conveniently packaged
as a node module and published on the [NPM registry].

**hls.js light** does not include alternate-audio, subtitles, CMCD, EME (DRM), or Variable Substitution support.

In addition, the following types are not available:

- `AudioStreamController`
- `AudioTrackController`
- `CuesInterface`
- `EMEController`
- `SubtitleStreamController`
- `SubtitleTrackController`
- `TimelineController`
- `CmcdController`

## Installation

via NPM

```sh
npm i @mistweaverco/hls.js-light
```

or Yarn

```sh
yarn add @mistweaverco/hls.js-light
```

## Usage

Basic usage would look something like this:

.js

```javascript
import HlsJs from '@mistweaverco/hls.js-light'

const videoElement = document.querySelector('video')
const videoSource = videoElement.dataset.src as string
const canPlayNativeHls = videoElement.canPlayType('application/vnd.apple.mpegurl') === 'probably' ||
  videoElement.canPlayType('application/vnd.apple.mpegurl') === 'maybe'

if (HlsJs.isSupported()) {
  hls = new HlsJs()
  hls.loadSource(videoSource)
  hls.attachMedia(videoElement)
} else if (canPlayNativeHls) {
  videoElement.src = videoSource
} else {
  console.error("Your browser doesn't support HLS")
}
```

.html

```html
<video
  data-src="https://mwcdn.co/demo-videos/View_From_A_Blue_Moon_Trailer_HLS/video.m3u8">
</video>
```

Just head over to the official [hls.js] repository or
refer to the [getting started] section of their docs for more in depth examples.

[light flavour]: https://github.com/video-dev/hls.js#build-tasks
[hls.js]: https://github.com/video-dev/hls.js
[NPM registry]: https://www.npmjs.com/package/@mistweaverco/hls.js-light
[getting started]: https://github.com/video-dev/hls.js/blob/master/docs/API.md#getting-started

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