michaeldzjap / waveplayer

An HTML5 based audio player with a waveform view

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to render multiple waveforms in one page correctly?

jimmyyao88 opened this issue · comments

commented

Hello Michael.

I'm trying to place multiple waveforms in a single page like soundcloud.

But everytime I create a waveform it will also create a new waveplayer instance on page which means it will create multiple audio tag elements in page.I have 100+ instance in a single page, and it will increase RAM usage soon.
And use playlist cannot display multiple waveform views in a single page.
I'm wondering how to use a single audio tag(a global context) to make it display multiple waveform view. (to avoid CPU and RAM over usage).

THX!

commented

The page looks like soundcloud stream feed.
Screen Shot 2021-03-13 at 8 58 24 PM

Yes, I understand your concerns @jimmyyao88. However, I don't think it is really possible to change this easily without considerable refactoring and rethinking some core design choices. I've had it in the back of my mind for a while now to do a thorough refactoring of waveplayer.js, but this won't happen any time soon. So unfortunately I don't think I'll be able to help you out much, at least not at this point in time.

commented

@michaeldzjap Thx for ur reply. I will check the source code and try to refactor. Thank you for bring us this great library!