Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cm-ngx-video-lazyloader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cm-ngx-video-lazyloader

`cm-ngx-video-lazyloader` is an Angular library for lazy loading videos using IntersectionObserver.

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cm-ngx-video-lazyloader

cm-ngx-video-lazyloader is an Angular library for lazy loading videos using IntersectionObserver.

Install

npm install --save cm-ngx-video-lazyloader

Usage

  1. Import CmNgxVideoLazyloaderModule into your root module.
  2. Add lazyLoadVideo directive to the video tag.
  3. Place the video url inside data-src attribute instead of src attribute. The url will be dynamically assinged to the src attribute when the video is in viewport.
Example:
<video lazyLoadVideo class="card-video" loop autoplay muted id="1" poster="https://example.org/assets/Americas-poster.jpg">
  <source data-src="https://example.org/assets/Americas.mp4" type="video/mp4" />
      Browser not supported
</video>

If you wish to lazy load the poster as well, then you can pass in an optional input param [lazyLoadPoster]="true" in the video tag and place the poster url inside the data-poster attribute. This attribute is set as false by default.

Example:

<video lazyLoadVideo [lazyLoadPoster]="true" data-poster="https://example.org/...></video>

Test Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

FAQs

Package last updated on 16 Apr 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc