Skip to content

EZ Web Audio / pauseAll

Function: pauseAll()

pauseAll(tracks): Promise<void>

Defined in: utils/collections.ts:85

Pauses all tracks in the provided array. Supports nested arrays which are recursively flattened. Skips items that don't have a pause method (only Track has pause). Uses best-effort error handling - attempts to pause all tracks even if some fail.

Parameters

tracks

NestedArray<Track>

Array of Track instances or nested arrays of Tracks

Returns

Promise<void>

Throws

CollectionError if any tracks fail to pause

Example

typescript
const tracks = [track1, track2, [track3, track4]]
await pauseAll(tracks)