stopProgressTracking
Stop dispatching progress events for one sound. The sound itself keeps playing. Use it when the seek bar for that sound is hidden and nothing needs the updates.
stopProgressTracking(id: string): void;
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | required | ID of the sound, stream or overlapping instance. |
Returns
Nothing.
Example
import { SoundHub } from 'soundhub';
const soundHub = new SoundHub();
await soundHub.loadSound('music', '/audio/theme.mp3');
soundHub.play('music'); // tracking starts, trackProgress is on by default
// The player panel is collapsed
soundHub.stopProgressTracking('music');
// For good: the next play() will not start it again
soundHub.updateSoundOptions('music', { trackProgress: false });
Good to know
- You do not need to call it on pause, stop or end. Tracking stops by itself then.
- It only lasts until the sound starts again. For a buffered sound, a
play(),resume(),seek()or loop restart turns tracking back on when itstrackProgressoption istrue. A stream turns it back on atplay()andresume(). Set that option tofalseto keep it off. - No event is dispatched, and an id without a tracker is ignored.
See also
startProgressTracking: start the events again.updateSoundOptions: switchtrackProgressoff for a sound.setProgressUpdateInterval: fewer updates instead of none.