
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
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
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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.