Skip to main content

Function: toPlayerEvent()

function toPlayerEvent(event: MpvEvent): PlayerEvent | undefined;

Defined in: packages/player/src/events.ts:104

Translate one flat native MpvEvent into the PlayerEvent discriminated union.

Parameters

ParameterTypeDescription
eventMpvEventThe event as delivered by setEventBatchListener.

Returns

PlayerEvent | undefined

The equivalent discriminated-union event, or undefined if the event was malformed (a property or log event without a name, which native never produces but the untrusted struct shape permits).

Remarks

Total and exhaustive: the switch is guarded by satisfies never, so adding a member to MpvEventKind is a compile error here rather than a silent drop.