Class: SubscribePublication
Manages the publication of MOQT objects to a subscriber for a specific track. Handles live object streaming, subscription lifecycle, and stream management.
Constructors
Constructor
new SubscribePublication(
client,track,subscribeMsg,requestStream,largestLocation?):SubscribePublication
Creates a new SubscribePublication instance.
Parameters
client
The MOQT client managing the subscription.
track
The track being published.
subscribeMsg
The subscribe message containing subscription details.
requestStream
The bidi request stream the SUBSCRIBE arrived on. Every message this publication sends back to the subscriber goes on it.
largestLocation?
The largest location seen so far, used for determining start location.
Returns
SubscribePublication
Properties
latestLocation
latestLocation:
Location|undefined
The latest location that was published to the subscriber.
track
readonlytrack:Track
The track being published.
Methods
cancel()
cancel():
void
Cancels the publication and cleans up resources. Removes the publication from the client's publication map.
Returns
void
done()
done(
statusCode):Promise<void>
Marks the publication as done and sends a PublishDone message to the client.
Parameters
statusCode
The status code indicating why the publication ended.
Returns
Promise<void>
Throws
:InternalError If sending the message fails.
publish()
publish():
Promise<void>
Publishes MOQT objects to the subscriber as they become available. Handles stream creation, object writing, and stream closure based on subscription parameters.
Returns
Promise<void>
Throws
:InternalError If the track does not support live content.
update()
update(
msg):void
Updates the subscription parameters and locations based on a RequestUpdate message.
Parameters
msg
The update message containing new request details.
Returns
void
Throws
:InvalidFilterError If the Range Filters the subscription would be left with cannot be applied; nothing is updated.