Skip to content
This repository was archived by the owner on Aug 7, 2018. It is now read-only.
This repository was archived by the owner on Aug 7, 2018. It is now read-only.

update getCurrentTime on audioprocess? #86

@thespice

Description

@thespice

Hi,

I've managed to statically display the current time and duration but the current time doesn't update. In wavesurfer.js you do it like this :

wavesurfer.on('audioprocess', function () {
  $('.play_counter').text( formatTime(wavesurfer.getCurrentTime()) );
});

But how do I do the same with react-wavesurfer?

This is how I'm currently calling it :

constructor(props) {
  .........
  this.handleReady = this.handleReady.bind(this);
}

handleReady(args) {
    this.current = args.wavesurfer.getCurrentTime();
    this.duration = args.wavesurfer.getDuration();
}

<WaveSurfer onReady=(this.handleReady} />

And then :

<div className="play_counter">{this.current}</div>
<div className="play_duration">{this.duration}</div>

I just don't know how to apply the audioprocess function to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions