Skip to main content

Function: toVisualizerError()

function toVisualizerError(thrown: unknown): PlayerError;

Defined in: packages/player/src/errors.ts:338

Map a throw from the native visualizer engine onto the typed taxonomy.

Parameters

ParameterTypeDescription
thrownunknownWhatever the native call threw.

Returns

PlayerError

The typed error. Never undefined — an untagged throw becomes an invalid-state carrying the original message, so nothing is swallowed.

Remarks

Deliberately separate from toPlayerError: an unclassified failure here must not be labelled mpv with a fabricated raw mpv string. The native side tags the one failure it can predict, [visualizer:unavailable] — a libmpv without the PCM tap patch.

There is no permission-denied member any more, and that absence is the feature: the old Android route went through android.media.audiofx.Visualizer, which the platform gates on RECORD_AUDIO for every audio session. Tapping mpv needs no permission at all, on either platform, so no consuming app has to put a microphone permission in its manifest.