
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@indevstudio/wavesurfer-react
Advanced tools
A simple wrapper around an awesome library called wavesurfer.js.
The purpose of the package is to provide an abstraction over wavesurfer.js API and to do it as close to react style of doing things as its maintainer(-s) can provide.
// Plugins prop format
// now you have to pass always an array of objects, where each can contain three properties,
// only one of them is required - plugin;
// plugin property is a plugin class, imported from wavesurfer.js
// example:
import RegionsPlugin from "wavesurfer.js/dist/plugin/wavesurfer.regions.min";
import TimelinePlugin from "wavesurfer.js/dist/plugin/wavesurfer.timeline.min";
import CursorPlugin from "wavesurfer.js/dist/plugin/wavesurfer.cursor.min";
const plugins = [
{
plugin: RegionsPlugin,
options: { dragSelection: true }
},
{
plugin: TimelinePlugin,
options: {
container: "#timeline"
}
},
{
plugin: CursorPlugin
}
];
Package provides the following set of components:
Core component of the package.
It creates wavesurfer instance and watches for changes in plugins list.
It accepts the following props set:
It is a list of plugins to use by WaveSurfer and has the following format:
import { WaveSurfer } from 'wavesurfer-react';
import MyCustomPlugin from 'my-custom-plugin-path';
const myPlugin = {
plugin: MyCustomPlugin,
options: {
someGreatOption: 'someGreatValue'
},
creator: 'myCustomCreate'
};
const plugins = [myPlugin];
<WaveSurfer plugins={plugins} />
The plugins
prop is watched inside WaveSurfer.
If plugin was disabled (it's not enlisted in plugins
prop) it will be destroyed,
otherwise added to wavesurfer plugins list and immediately initialized.
It is a function, that is called after WaveSurfer instance has been mounted.
It has only one argument - WaveSurfer instance.
It is used to configure WaveForm.
It accepts all options, passed into WaveSurfer.create, but except plugins.
Read the full list of available options.
Think of it as a some kind of helper component.
It can be used to imperatively control regions, appearing on WaveForm if you're using RegionsPlugin.
If region is already present of WaveForm it creation will be avoided and existing instance is used.
On mount, it will try to find region with the same region identifier and then attaches itself to it.
If region component did not find appropriate region, then it creates a region itself.
It accepts the following props:
Rest passed props are passed as region's data into wavesurfer.
Can be used to imperatively control markers.
For now, only time
is updatable and is watched for further updates, that are coming from outside of component.
It accepts the following props:
onClick
is emitted when marker is clickedonDrag
is emitted when drag operation is startedonDrop
is emitted when element is released after dragRest passed props are used as marker's data
Region
component.
Try to not hard-bind redux-state with wavesurfer-react too tight or use an instance of wavesurfer to operate regions.onMount
to instantly clear artificial markers.You can see how this package is intended to be used here
P.S. Tasks that are marked with start are in theory possible.
FAQs
react wrapper for @indevstudio/wavesurfer.js
We found that @indevstudio/wavesurfer-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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 Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.