How To: Connect Waveform to Audio or Video
Problem: You want to visualize audio from an audio or video element with a waveform.
Solution: Use the target attribute on the waveform element, referencing the id of the audio or video element.
Live
Steps:
- Add an
idattribute to your<ef-audio>or<ef-video>element. - Set the
targetattribute on<ef-waveform>to match thatidvalue. - The waveform will automatically synchronize with the target element's playback.
The waveform receives real-time audio frequency data from the target element and visualizes it during playback.