Constructor
new PresentationWaveform(mountEl, ctrl, callbacks)
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mountEl | HTMLElement | Container element to render the player into. | |||||||||||||||
ctrl | PresentationController | Shared controller for hover/select state. | |||||||||||||||
callbacks | object | Event callbacks.Properties
|
- Source
Methods
drawRegions()
Repaints the region canvas, drawing one bar per segment coloured by speaker and sized/highlighted according to active, hovered, and selected state.
- Source
loadFromProject(project)
Initialises WaveSurfer and loads audio from the given project.
Parameters:
| Name | Type | Description |
|---|---|---|
project | Project | The project whose waveform should be loaded. |
- Source
positionSectionBreakLines()
Updates the left position of each section-break line based on current scroll and zoom. Called from drawRegions() on every redraw.
- Source
renderSectionBreakLines()
Creates (or recreates) the section-break line and label DOM elements inside the waveform area. Called once per load after the waveform is ready.
- Source
setHoveredRegion()
Triggers a region redraw after the hovered segment changes.
- Source
setSelectedRegion(idx)
Seeks to the selected segment and triggers a region redraw.
Parameters:
| Name | Type | Description |
|---|---|---|
idx | number | Segment index to select and seek to. |
- Source