Socket
Book a DemoInstallSign in
Socket

vue-wavesurfer-player

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-wavesurfer-player

Simple Vue wraper for wavesurfer.js

latest
Source
npmnpm
Version
0.0.12
Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

Simple Vue wraper for wavesurfer.js

alt text

Example

Usage

//main.js
import { createApp } from 'vue'
import App from './App.vue'
import WavesurferPlugin from './WavesurferPlugin';

const app = createApp(App);
app.use(WavesurferPlugin);
app.mount('#app')

import type { WavesurferOptions } from "vue-wavesurfer-player/dist/components/WavesurferOptions";

//import styles
<style>
  @import 'vue-wavesurfer-player/styles.css';
</style>

let options: WavesurferOptions = {
  waveColor: "violet",
  progressColor: "purple",
  scrollParent: false,
  backend: "WebAudio",
  barHeight: .8,
  cursorWidth: 3,
  cursorColor: "#eb7ee9",
  height: 64,
  barWidth: 0.1,
  barGap: 1.5
} as WavesurferOptions;
    
<Wavesurfer
  class="wave-surfer-item"
  :options="wavesurferOption1"
  src="./../soundEffect.wav"
  effectName="Cick effect"
></Wavesurfer>


// or with base64 file
<Wavesurfer
  class="wave-surfer-item"
  :options="wavesurferOption2"
  :srcBase64="fileAsBlob"
  effectName="Cick effect 2"
></Wavesurfer>


by adding: ref="playerRef"
like
<Wavesurfer
  ref="playerRef"
  class="wave-surfer-item"
  :options="wavesurferOption2"
  :srcBase64="fileAsBlob"
  effectName="Cick effect 2"
></Wavesurfer>

you can access functions like:
this.$refs.playerRef.loadBlob(this.fileAsBlob2);
this.$refs.playerRef.loadFile("your_file_url");
this.$refs.playerRef.getDurationInMiliSeconds();

FAQs

Package last updated on 25 Jul 2022

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.