Skip to main content

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​

ParameterTypeDefaultDescription
idstringrequiredID 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 its trackProgress option is true. A stream turns it back on at play() and resume(). Set that option to false to keep it off.
  • No event is dispatched, and an id without a tracker is ignored.

See also​