# @maeertin/medialoaded

> A simple utility for checking whether images and/or videos have been loaded.

Latest version **1.2.1** (published 2020-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @maeertin/medialoaded
pnpm add @maeertin/medialoaded
yarn add @maeertin/medialoaded
bun add @maeertin/medialoaded
```

## 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.2.1 |
| Published | 2020-05-15 |
| First published | 2020-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Martin Barri |
| Maintainers | maeertin |
| Keywords | images, video, poster, media, loaded |

## Links

- npm: https://www.npmjs.com/package/@maeertin/medialoaded
- Repository: https://github.com/maeertin/mediaLoaded
- Homepage: https://github.com/maeertin/mediaLoaded#readme
- Issues: https://github.com/maeertin/mediaLoaded/issues
- npm.io page: https://npm.io/package/@maeertin/medialoaded

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2020-05-15
- 1.2.0 — 2020-05-15
- 1.1.0 — 2020-02-07
- 1.0.1 — 2020-01-10
- 1.0.0 — 2020-01-09
- 0.0.3 — 2020-01-08
- 0.0.2 — 2020-01-08
- 0.0.1 — 2020-01-08

## README

# mediaLoaded

A simple utility for checking whether images, videos and/or video posters have been loaded. Inspired by [imagesLoaded](https://github.com/desandro/imagesloaded).

Sidenote:
On touch devices, all videos that don't autoplay will be ignored as video events won't trigger until user interaction.

Install with [npm](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/):

```bash
# via npm
npm install @maeertin/medialoaded

# or Yarn
yarn add @maeertin/medialoaded
```

Usage:

```js
import mediaLoaded from '@maeertin/medialoaded'

// Single node as target argument
const element = document.querySelector('#container')
mediaLoaded(element, instance => {
  console.log('All media loaded', instance)
})

// nodeList as target argument
const elements = document.querySelectorAll('.post')
mediaLoaded(elements, instance => {
  console.log('All media loaded', instance)
})

// String selector as target argument
mediaLoaded('.post', instance => {
  console.log('All media loaded', instance)
})
```

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