SubscriptionEvent
type SubscriptionEvent = | { type: "subscribed"; value: SubscribeOk;} | { type: "object"; value: MoqtObject;} | { type: "publisherDone"; value: PublishDone;} | { type: "subgroupEnd"; value: { endOfGroup: boolean; groupId: number; subgroupId: number; };} | { type: "subgroupReset"; value: { error: unknown; groupId: number; };} | { type: "stateNotify"; value: MessageParameters;} | { type: "goaway"; value: Goaway;} | { type: "updateOk"; value: undefined;};Defined in: relay-sdks/ts/src/subscription.ts:29
Delivery order is callback arrival order, with no ordering guarantee across streams.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ type: "subscribed"; value: SubscribeOk;}type: "subscribed";The relay accepted the subscription (SUBSCRIBE_OK).
value: SubscribeOk;The acceptance info onSubscribed receives.
Type Literal
Section titled “Type Literal”{ type: "object"; value: MoqtObject;}type: "object";One object arrived, including an object that carries only a protocol status.
value: MoqtObject;The object; its payload is uninterpreted bytes.
Type Literal
Section titled “Type Literal”{ type: "publisherDone"; value: PublishDone;}type: "publisherDone";The publisher finished with the track (PUBLISH_DONE). Not an ending: trailing objects can follow.
value: PublishDone;The done’s status, stream count and reason.
Type Literal
Section titled “Type Literal”{ type: "subgroupEnd"; value: { endOfGroup: boolean; groupId: number; subgroupId: number; };}type: "subgroupEnd";A subgroup stream finished cleanly (FIN); only that subgroup ended.
value: object;Which subgroup ended.
value.endOfGroup
Section titled “value.endOfGroup”endOfGroup: boolean;Whether the subgroup’s header marked it as holding the group’s largest object.
value.groupId
Section titled “value.groupId”groupId: number;The group the subgroup belongs to.
value.subgroupId
Section titled “value.subgroupId”subgroupId: number;The subgroup that ended.
Type Literal
Section titled “Type Literal”{ type: "subgroupReset"; value: { error: unknown; groupId: number; };}type: "subgroupReset";A subgroup stream was reset; objects from it may be missing. Delivery continues.
value: object;Which group the reset stream carried, and why it failed.
value.error
Section titled “value.error”error: unknown;The transport’s stream error, as the runtime reported it.
value.groupId
Section titled “value.groupId”groupId: number;The group the reset subgroup belongs to.
Type Literal
Section titled “Type Literal”{ type: "stateNotify"; value: MessageParameters;}type: "stateNotify";The publisher changed subscription state on its own (PUBLISH_STATE_NOTIFY).
value: MessageParameters;Only the parameters that changed.
Type Literal
Section titled “Type Literal”{ type: "goaway"; value: Goaway;}type: "goaway";The relay sent GOAWAY on this request. Informational; the SDK does not retry.
value: Goaway;The relay’s suggested new session URI (may be empty) and timeout.
Type Literal
Section titled “Type Literal”{ type: "updateOk"; value: undefined;}type: "updateOk";The relay acknowledged an update() (REQUEST_OK).
value: undefined;Always undefined; the acknowledgment carries nothing.