moqtail 0.9.0 → 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 +8 -16
- package/dist/client.cjs +4274 -4230
- package/dist/client.d.cts +159 -93
- package/dist/client.d.ts +159 -93
- package/dist/client.js +4274 -4231
- package/dist/index.cjs +4752 -4639
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4497 -4435
- package/dist/logger-C6QS408Z.d.cts +34 -0
- package/dist/logger-C6QS408Z.d.ts +34 -0
- package/dist/model.cjs +2055 -1982
- package/dist/model.d.cts +83 -52
- package/dist/model.d.ts +83 -52
- package/dist/model.js +2021 -1953
- package/dist/{version_parameter-DXBOBueW.d.cts → setup_parameter-BOeGq6Mv.d.cts} +840 -759
- package/dist/{version_parameter-DXBOBueW.d.ts → setup_parameter-BOeGq6Mv.d.ts} +840 -759
- package/dist/util.cjs +45 -0
- package/dist/util.d.cts +2 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.js +41 -1
- package/package.json +1 -1
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 `
|
|
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
|
|
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
|
|
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 `
|
|
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
|
|
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
|
|
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
|
|
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
|
|
410
|
+
if (result instanceof RequestError) {
|
|
419
411
|
console.error(`Track status request failed: ${result.reasonPhrase}`)
|
|
420
412
|
} else {
|
|
421
413
|
// result is TrackStatus
|