moqtail 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -127,7 +127,7 @@ As a subscriber, the MOQtail client enables you to discover, request, and consum
127
127
 
128
128
  ### Live Content Subscription
129
129
 
130
- For real-time streaming content, use `subscribe()` which returns either a `ReadableStream<MoqtObject>` or a `SubscribeError`:
130
+ For real-time streaming content, use `subscribe()` which returns either a `ReadableStream<MoqtObject>` or a `RequestError`:
131
131
 
132
132
  #### Subscribe Implementation
133
133
 
@@ -156,11 +156,11 @@ const subscribe = new Subscribe(
156
156
 
157
157
  const result = await client.subscribe(subscribe)
158
158
 
159
- if (result instanceof SubscribeError) {
159
+ if (result instanceof RequestError) {
160
160
  console.error(`Subscription failed: ${result.reasonPhrase}`)
161
161
  // Handle error based on error code
162
162
  switch (result.errorCode) {
163
- case SubscribeErrorCode.InvalidRange:
163
+ case RequestErrorCode.InvalidRange:
164
164
  // Adjust range and retry
165
165
  break
166
166
  default:
@@ -188,7 +188,7 @@ if (result instanceof SubscribeError) {
188
188
 
189
189
  ### On-Demand Content Fetching
190
190
 
191
- For static or archived content, use `fetch()` which returns either a `ReadableStream<MoqtObject>` or a `FetchError`:
191
+ For static or archived content, use `fetch()` which returns either a `ReadableStream<MoqtObject>` or a `RequestError`:
192
192
 
193
193
  #### Fetch Implementation
194
194
 
@@ -213,7 +213,7 @@ const fetch = new Fetch(
213
213
 
214
214
  const result = await client.fetch(fetch)
215
215
 
216
- if (result instanceof FetchError) {
216
+ if (result instanceof RequestError) {
217
217
  console.error(`Fetch failed: ${result.reasonPhrase}`)
218
218
  // Handle fetch error
219
219
  } else {
@@ -249,14 +249,6 @@ function processObject(object: MoqtObject) {
249
249
  processData(object.payload)
250
250
  }
251
251
  break
252
- case ObjectStatus.ObjectDoesNotExist:
253
- // Object was not available
254
- handleMissingObject(object.groupId, object.objectId)
255
- break
256
- case ObjectStatus.GroupDoesNotExist:
257
- // Entire group was not available
258
- handleMissingGroup(object.groupId)
259
- break
260
252
  case ObjectStatus.EndOfGroup:
261
253
  // Marks the end of a group
262
254
  finalizeGroup(object.groupId)
@@ -278,7 +270,7 @@ function processObject(object: MoqtObject) {
278
270
  const subscribe = new Subscribe(/*...*/)
279
271
  const result = await client.subscribe(subscribe)
280
272
 
281
- if (result instanceof SubscribeError) {
273
+ if (result instanceof RequestError) {
282
274
  console.error(`Subscription failed: ${result.reasonPhrase}`)
283
275
  } else {
284
276
  console.log('Subscription successful, processing stream...')
@@ -331,7 +323,7 @@ async function createSubscriber() {
331
323
 
332
324
  const result = await client.subscribe(subscribe)
333
325
 
334
- if (result instanceof SubscribeError) {
326
+ if (result instanceof RequestError) {
335
327
  console.error(`Failed to subscribe: ${result.reasonPhrase}`)
336
328
  return
337
329
  }
@@ -415,7 +407,7 @@ Query the status of specific tracks:
415
407
  const trackStatus = new TrackStatusMessage(client.nextClientRequestId, FullTrackName.tryNew('live/conference', 'video'))
416
408
 
417
409
  const result = await client.trackStatus(trackStatus)
418
- if (result instanceof TrackStatusError) {
410
+ if (result instanceof RequestError) {
419
411
  console.error(`Track status request failed: ${result.reasonPhrase}`)
420
412
  } else {
421
413
  // result is TrackStatus