🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

lit-player-youtube

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lit-player-youtube

LitPlayerYoutube is a lightweight and customizable Web Component built with Lit that provides a simple way to embed and control YouTube videos using the official YouTube API.

0.0.39
latest
Source
npm
Version published
Weekly downloads
161
-86.79%
Maintainers
1
Weekly downloads
 
Created
Source

Lit-Player-Youtube

npm version License: MIT Downloads

LitPlayerYoutube is a YouTube-based video player built with Lit that uses the official YouTube API to control video playback.

Lightweight, customizable, and easy to use, it can be used as a pure Web Component or integrated via React with the official wrapper.

Table of Contents

Requirements

  • Node.js >= 14.x
  • Modern browser with Web Components support

Installation

npm install lit-player-youtube

Usage

To use the component, simply import it and place the tag in your project. No need to instantiate classes or call methods directly.

Importing

LIT:

    import { LitPlayerYoutube } from "lit-player-youtube";

REACT:

    import { LitPlayerYoutubeReact } from "lit-player-youtube";

Using in Lit

Example controlling width and height:

<div style="width: 600px; height: 350px;">
    <lit-youtube-player video="https://www.youtube.com/watch?v=tPBbeszlIXw"></lit-youtube-player>
</div>

Using in React

Example controlling width and height:

import React from "react";
import { LitPlayerYoutubeReact } from "lit-player-youtube";

function App() {
  return (
    <div style={{ width: "600px", height: "350px" }}>
      <LitPlayerYoutubeReact video="https://www.youtube.com/watch?v=tPBbeszlIXw" />
    </div>
  );
}

export default App;

Example

Controlling Dimensions

You can control the player size by wrapping the component inside a container with specific dimensions, as the component adapts to 100% width and height of its container.

The component is also responsive.

Contributing

Contributions are very welcome! To contribute, follow these steps:

  • Fork this repository.
  • Create a feature branch (git checkout -b feature/new-feature).
  • Commit your changes (git commit -m 'Add new feature').
  • Push to the branch (git push origin feature/new-feature).
  • Open a Pull Request.

License

MIT © Leonardo Leal Araujo

Keywords

youtube

FAQs

Package last updated on 01 Jun 2025

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