
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
raptor-howler
Advanced tools
Minimal React wrapper for howlerjs
howler.js + react-aptor + ❤ = raptor-howler️
Minimal React wrapper for howler.js using react-aptor
npm install --save raptor-howler
or with yard
yarn add raptor-howler
import RaptorHowler from 'raptor-howler'
const App = () => (
<RaptorHowler
src="https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"
playing={true}
/>
);
You can find a complete example for basic functionality of raptor-howler using create-react-app, here
props are passed directly to new Howl
with default value
for more info about props types see howler.js core section
new Howl({
src: props.src,
xhr: props.xhr || {},
format: props.format || [],
mute: props.mute || false,
loop: props.loop || false,
preload: props.preload || false,
rate: props.rate || 1.0,
volume: props.volume || 1.0,
onend: props.onEnd,
onplay: props.onPlay,
onpause: props.onPause,
onvolume: props.onVolume,
onstop: props.onStop,
onrate: props.onRate,
onload: props.onLoad,
onloaderror: props.onLoadError,
html5: props.html5 || false
})
just pass a ref to <RaptorHowler />
and you can access the latest howler instance using
ref.current._howler
field.
function App() {
const apiRef = useRef(null);
return (
<div className="app">
<RaptorHowler
src="https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"
ref={apiRef}
/>
<button
onClick={() => {
const { current: api } = apiRef;
if (!api) return;
console.log(api._howler.duration());
}}>
log audio duration
</button>
</div>
);
}
Take a look at api.ts for all pre-defined api which make your work easier
<button
onClick={() => {
if (!apiRef.current) return;
const playing = apiRef.current._playing();
if (!playing) apiRef.current.play();
else apiRef.current.pause();
}}>
Toggle playing state from (prop API)
</button>
💻 Developer/Maintainer (BTC):
bc1qq8qq63ex7svkkjdjn5axu8angfxytvs83nlujk
License MIT
FAQs
The react-aptor connector for Howler.js
The npm package raptor-howler receives a total of 0 weekly downloads. As such, raptor-howler popularity was classified as not popular.
We found that raptor-howler 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.