New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@maeertin/medialoaded

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maeertin/medialoaded

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

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
1
Created
Source

mediaLoaded

A simple utility for checking whether images, videos and/or video posters have been loaded. Inspired by 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 or Yarn:

# via npm
npm install @maeertin/medialoaded

# or Yarn
yarn add @maeertin/medialoaded

Usage:

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)
})

Keywords

images

FAQs

Package last updated on 15 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts