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

ngx-lite-video

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-lite-video

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

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

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

PropertyTypeDefaultDescription
videoIdstringundefinedVideo ID to be viewed
videoTitlestringundefinedTitle to be displayed in lazy mode
hasControlsbooleanfalseShows/hides video controls in iframe
loopbooleanfalseEnables video looping
allowFullScreenbooleantrueEnables/disables fullscreen button in iframe
startnumberundefinedSets starting video time (in seconds)
endnumberundefinedSets ending video time (in seconds)
styleClassstringundefinedExternal styling class
thumbQuality'sd', 'medium', 'high', 'max''high'Lazy image quality

Vimeo Attributes

PropertyTypeDefaultDescription
videoIdstringundefinedVideo ID to be viewed
thumbQuality'sd', 'medium', 'high', 'max''high'Lazy image quality
showTitlebooleanfalseEnables/disables showing title in lazy mode
hasControlsbooleanfalseShows/hides video controls in iframe
loopbooleanfalseEnables video looping
isBackgroundbooleanfalseEnables vimeo background mode, please refer to https://developer.vimeo.com/player/sdk/embed
styleClassstringundefinedExternal 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.

Keywords

FAQs

Package last updated on 24 Apr 2023

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