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

tailwind-player

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwind-player

Standalone tailwind component with audio player functionality

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Tailwind Audio Player

A lightweight TailwindCSS React wrapper for the default audio element.

Installation

npm install --save tailwind-player

You should have the react and react-dom installed.

Usage

import TailwindPlayer from 'tailwind-player';
//...
<TailwindPlayer
  src="https://youtu.be/dQw4w9WgXcQ?si=Id6V7AafrYLSmgNd"
  loop
  autoplay
/>

Example

See the example directory for a basic working example of using this project. To run it locally, run npm install in the example directory and then npm start.

Props

PropTypeDefault
autoPlayBooleanfalse
childrenElementnull
classNameStringempty string
controlsBooleanfalse
crossOriginStringempty string
controlsListStringempty string
idStringempty string
loopBooleanfalse
mutedBooleanfalse
volumeNumber1.0
preloadString'metadata'
srcStringempty string
styleObject---
PropTypeDescription
listenIntervalNumberIndicates how often to call the onListened prop during playback, in milliseconds. Default is 10000.
onAbortFunctioncalled when unloading the audio player, like when switching to a different src file. Passed the event.
onCanPlayFunctioncalled when enough of the file has been downloaded to be able to start playing. Passed the event.
onCanPlayThroughFunctioncalled when enough of the file has been downloaded to play through the entire file. Passed the event.
onEndedFunctioncalled when playback has finished to the end of the file. Passed the event.
onErrorFunctioncalled when the audio tag encounters an error. Passed the event.
onListenFunctioncalled every listenInterval milliseconds during playback. Passed the event.
onPauseFunctioncalled when the user pauses playback. Passed the event.
onPlayFunctioncalled when the user taps play. Passed the event.
onSeekedFunctioncalled when the user drags the time indicator to a new time. Passed the event.
onVolumeChangedFunctioncalled when the user changes the volume, such as by dragging the volume slider
onLoadedMetadataFunctioncalled when the metadata for the given audio file has finished downloading. Passed the event.

Keywords

FAQs

Package last updated on 07 Apr 2024

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