🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@daviddarnes/play-button

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@daviddarnes/play-button

A Web Component to play audio or video with a button

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

play-button

A Web Component to play audio or video with a button.

Demo

Examples

<script type="module" src="play-button.js"></script>

<play-button>
  <audio controls src="https://darn.es/sounds/daviddarnes.m4a"></audio>
  <button>Play</button>
</play-button>

Features

This Web Component allows you to:

  • Control audio or video elements with a single button which can play and pause the audio or video

Installation

You have a few options (choose one of these):

  • Install via npm: npm install @daviddarnes/play-button
  • Download the source manually from GitHub into your project.
  • Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)

Usage

Make sure you include the <script> in your project (choose one of these):

<!-- Host yourself -->
<script type="module" src="play-button.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script type="module" src="https://www.unpkg.com/@daviddarnes/play-button@1.0.0/play-button.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script type="module" src="https://esm.sh/@daviddarnes/play-button@1.0.0"></script>

Credit

With thanks to the following people:

Keywords

web

FAQs

Package last updated on 12 Dec 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