question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wavesurfer.js autoplay on load

See original GitHub issue

I am using wavsurfer.js for a site and I have been able to get it working almost the way I want it to. I have several buttons that all load a different track into the player but I would really love to know how to make it is so the the tracks start playing automatically once loaded. for the track selection buttons I have this code that loads the track.

<div class="controls"><button class="btn" onclick="wavesurfer.load('wavesurfer/media/song_01.mp3');"> Play </button>

Any help or ideas would be greatly appreciated as I am new to this. Cheers

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
katspaughcommented, Sep 29, 2014

Oh, sorry, it’s ready, not load event. So:

wavesurfer.on('ready', wavesurfer.play.bind(wavesurfer));
0reactions
Rayobeatscommented, Jan 29, 2021

Hi. My wavesufer autoplays wen i load a page with it, i would like to stop auotoplay, how do i stop autoplay?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to detect when Autoplay fails in WaveSurfer.js?
After searching around, I found that WaveSurfer JS uses WebAudio (an object called AudioContext is created). According to the Google page:.
Read more >
WaveSurfer Events
wavesurfer.js is an HTML 5 audio player and waveform visualizer, made with JavaScript and ... ready – When audio is loaded, decoded and...
Read more >
WaveSurfer Options
option type default audioRate float 1 audioContext object none audioScriptProcessor object none
Read more >
FAQ
The audio will start playing as you press play. A thin line will be displayed until the whole audio file is downloaded and...
Read more >
src/mediaelement.js
load (url, container, peaks, preload) {; const media = document.createElement(this.mediaType);; media.controls = this.params.mediaControls;; media.autoplay ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found