Socket
Socket
Sign inDemoInstall

tailwind-player

Package Overview
Dependencies
6
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tailwind-player

Standalone tailwind component with audio player functionality


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

Readme

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

Last updated on 07 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc