npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-lite-video

v1.2.0

Published

ngx-lite-video is an Angular package for lazy loading embedded YouTube and Vimeo videos, improving page speed and user experience.

Downloads

729

Readme

ngx-lite-video

ngx-lite-video is an Angular package that provides lazy loading capabilities for embedded iframes from popular video sharing platforms like YouTube and Vimeo. The package is designed to optimize the loading of embedded videos, improving page load times and reducing data usage.

The package is built specifically for Angular, utilizing Angular's onpush change detection strategy for efficient rendering and updating of video components. It also includes features such as customizable lazy loading thresholds and options for controlling video playback and display.

This package requires a minimum of Angular version 13 and rxjs version 7.2 to function properly.

Try it yourself by measuring the performance on Demo page

Key Features

  • Lazy loads embedded iframes for YouTube and Vimeo videos
  • Built specifically for Angular
  • Uses Angular OnPush change detection for optimized performance
  • Customizable options including video quality, start time, and more
  • Provides a seamless user experience by loading videos only when needed

Install

npm install ngx-lite-video --save

Once installed, import the module that you wish to use in your desired module

@NgModule({
  //...
  imports: [
    //...
    NgxLiteVimeoModule, // Vimeo lite module
    NgxLiteYoutubeModule, // YouTube lite module
  ],
})
export class YourModule {}

Usage

To use ngx-lite-video, add the 'ngx-lite-youtube'/'ngx-lite-vimeo' component to your template and configure its properties as needed:

<!-- YouTube Component -->
<ngx-lite-youtube videoId="Ys7xdebd66Y"></ngx-lite-youtube>

<!-- Vimeo Component -->
<ngx-lite-vimeo videoId="786570322"></ngx-lite-vimeo>

Custom styles

To override styling create a class in global style.scss file & provide it to styleClass attribute

For more detailed examples see Demo page

API

YouTube Attributes

| Property | Type | Default | Description | | --------------- | ------- | --------- | -------------------------------------------- | | videoId | string | undefined | Video ID to be viewed | | videoTitle | string | undefined | Title to be displayed in lazy mode | | hasControls | boolean | false | Shows/hides video controls in iframe | | loop | boolean | false | Enables video looping | | allowFullScreen | boolean | true | Enables/disables fullscreen button in iframe | | start | number | undefined | Sets starting video time (in seconds) | | end | number | undefined | Sets ending video time (in seconds) | | styleClass | string | undefined | External styling class | | thumbQuality | 'sd', 'medium', 'high', 'max' | 'high' | Lazy image quality |

Vimeo Attributes

| Property | Type | Default | Description | | ------------ | ------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | videoId | string | undefined | Video ID to be viewed | | thumbQuality | 'sd', 'medium', 'high', 'max' | 'high' | Lazy image quality | | showTitle | boolean | false | Enables/disables showing title in lazy mode | | hasControls | boolean | false | Shows/hides video controls in iframe | | loop | boolean | false | Enables video looping | | isBackground | boolean | false | Enables vimeo background mode, please refer to https://developer.vimeo.com/player/sdk/embed | | styleClass | string | undefined | External styling class |

Contributing

Contributions are welcome. You can start by creating new Issue with proposal or bug report.

License

ngx-lite-video is an open source package released under the MIT license. See the LICENSE file for more information.