
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-simple-audio-player
Advanced tools
A React component with graphics for playing audio files
npm install react-simple-audio-player --save
import React, { Component } from 'react'
import PlayAudio from 'react-simple-audio-player'
class App extends Component {
render () {
return <PlayAudio url={'http://www.noiseaddicts.com/samples_1w72b820/4186.mp3'} />
}
}
export default App;
The component uses react-player
package to play media and add simple design and controls to extend the package.
Prop | Description | Default |
---|---|---|
url | The url of an audio to play | |
width | Set the width and height (height is equal to width) of the player | 60px |
simpleMode | Set to true disable seconds counter, automatically true with width less then 45px | false |
colorScale | Pass array of 5 colors for theme personalisation | scaled red shades (see demo) |
import React, { Component } from 'react'
import PlayAudio from 'react-simple-audio-player'
import chroma from "chroma-js"
const colorScale = chroma
.scale([
'#0199CB',
'#ffffff',
])
.mode('lch')
.colors(5)
class App extends Component {
render () {
return <PlayAudio url={'http://www.noiseaddicts.com/samples_1w72b820/4186.mp3'} colorScale={colorScale} />
}
}
export default App
Result:
FAQs
React component for playing audio files.
We found that react-simple-audio-player demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.