googlevideo 1.0.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.
Files changed (73) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +66 -0
  3. package/bundle/index.cjs +7134 -0
  4. package/bundle/index.cjs.map +7 -0
  5. package/dist/protos/generated/misc/common.d.ts +47 -0
  6. package/dist/protos/generated/misc/common.js +365 -0
  7. package/dist/protos/generated/video_streaming/buffered_range.d.ts +50 -0
  8. package/dist/protos/generated/video_streaming/buffered_range.js +403 -0
  9. package/dist/protos/generated/video_streaming/client_abr_state.d.ts +69 -0
  10. package/dist/protos/generated/video_streaming/client_abr_state.js +647 -0
  11. package/dist/protos/generated/video_streaming/crypto_params.d.ts +35 -0
  12. package/dist/protos/generated/video_streaming/crypto_params.js +143 -0
  13. package/dist/protos/generated/video_streaming/encrypted_player_request.d.ts +35 -0
  14. package/dist/protos/generated/video_streaming/encrypted_player_request.js +219 -0
  15. package/dist/protos/generated/video_streaming/format_initialization_metadata.d.ts +35 -0
  16. package/dist/protos/generated/video_streaming/format_initialization_metadata.js +207 -0
  17. package/dist/protos/generated/video_streaming/media_capabilities.d.ts +43 -0
  18. package/dist/protos/generated/video_streaming/media_capabilities.js +315 -0
  19. package/dist/protos/generated/video_streaming/media_header.d.ts +49 -0
  20. package/dist/protos/generated/video_streaming/media_header.js +328 -0
  21. package/dist/protos/generated/video_streaming/next_request_policy.d.ts +30 -0
  22. package/dist/protos/generated/video_streaming/next_request_policy.js +132 -0
  23. package/dist/protos/generated/video_streaming/onesie_header.d.ts +45 -0
  24. package/dist/protos/generated/video_streaming/onesie_header.js +339 -0
  25. package/dist/protos/generated/video_streaming/onesie_header_type.d.ts +32 -0
  26. package/dist/protos/generated/video_streaming/onesie_header_type.js +182 -0
  27. package/dist/protos/generated/video_streaming/onesie_player_request.d.ts +31 -0
  28. package/dist/protos/generated/video_streaming/onesie_player_request.js +122 -0
  29. package/dist/protos/generated/video_streaming/onesie_player_response.d.ts +29 -0
  30. package/dist/protos/generated/video_streaming/onesie_player_response.js +121 -0
  31. package/dist/protos/generated/video_streaming/onesie_request.d.ts +36 -0
  32. package/dist/protos/generated/video_streaming/onesie_request.js +199 -0
  33. package/dist/protos/generated/video_streaming/playback_cookie.d.ts +30 -0
  34. package/dist/protos/generated/video_streaming/playback_cookie.js +110 -0
  35. package/dist/protos/generated/video_streaming/playback_start_policy.d.ts +31 -0
  36. package/dist/protos/generated/video_streaming/playback_start_policy.js +155 -0
  37. package/dist/protos/generated/video_streaming/proxy_status.d.ts +16 -0
  38. package/dist/protos/generated/video_streaming/proxy_status.js +86 -0
  39. package/dist/protos/generated/video_streaming/request_cancellation_policy.d.ts +33 -0
  40. package/dist/protos/generated/video_streaming/request_cancellation_policy.js +173 -0
  41. package/dist/protos/generated/video_streaming/sabr_error.d.ts +26 -0
  42. package/dist/protos/generated/video_streaming/sabr_error.js +77 -0
  43. package/dist/protos/generated/video_streaming/sabr_redirect.d.ts +25 -0
  44. package/dist/protos/generated/video_streaming/sabr_redirect.js +61 -0
  45. package/dist/protos/generated/video_streaming/stream_protection_status.d.ts +26 -0
  46. package/dist/protos/generated/video_streaming/stream_protection_status.js +77 -0
  47. package/dist/protos/generated/video_streaming/streamer_context.d.ts +89 -0
  48. package/dist/protos/generated/video_streaming/streamer_context.js +915 -0
  49. package/dist/protos/generated/video_streaming/time_range.d.ts +27 -0
  50. package/dist/protos/generated/video_streaming/time_range.js +101 -0
  51. package/dist/protos/generated/video_streaming/video_playback_abr_request.d.ts +69 -0
  52. package/dist/protos/generated/video_streaming/video_playback_abr_request.js +659 -0
  53. package/dist/src/core/ChunkedDataBuffer.d.ts +20 -0
  54. package/dist/src/core/ChunkedDataBuffer.js +82 -0
  55. package/dist/src/core/ServerAbrStream.d.ts +38 -0
  56. package/dist/src/core/ServerAbrStream.js +272 -0
  57. package/dist/src/core/UMP.d.ts +10 -0
  58. package/dist/src/core/UMP.js +110 -0
  59. package/dist/src/core/index.d.ts +3 -0
  60. package/dist/src/core/index.js +3 -0
  61. package/dist/src/index.d.ts +4 -0
  62. package/dist/src/index.js +4 -0
  63. package/dist/src/utils/EventEmitterLike.d.ts +8 -0
  64. package/dist/src/utils/EventEmitterLike.js +50 -0
  65. package/dist/src/utils/Protos.d.ts +23 -0
  66. package/dist/src/utils/Protos.js +23 -0
  67. package/dist/src/utils/helpers.d.ts +63 -0
  68. package/dist/src/utils/helpers.js +101 -0
  69. package/dist/src/utils/index.d.ts +4 -0
  70. package/dist/src/utils/index.js +3 -0
  71. package/dist/src/utils/types.d.ts +65 -0
  72. package/dist/src/utils/types.js +1 -0
  73. package/package.json +61 -0
@@ -0,0 +1,647 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.2.0
4
+ // protoc v5.28.0
5
+ // source: video_streaming/client_abr_state.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { MediaCapabilities } from "./media_capabilities.js";
9
+ export const protobufPackage = "video_streaming";
10
+ export var ClientAbrState_MediaType;
11
+ (function (ClientAbrState_MediaType) {
12
+ ClientAbrState_MediaType[ClientAbrState_MediaType["MEDIA_TYPE_DEFAULT"] = 0] = "MEDIA_TYPE_DEFAULT";
13
+ ClientAbrState_MediaType[ClientAbrState_MediaType["MEDIA_TYPE_AUDIO"] = 1] = "MEDIA_TYPE_AUDIO";
14
+ ClientAbrState_MediaType[ClientAbrState_MediaType["MEDIA_TYPE_VIDEO"] = 2] = "MEDIA_TYPE_VIDEO";
15
+ ClientAbrState_MediaType[ClientAbrState_MediaType["USE_SERVER_FORMAT_FILTER"] = 3] = "USE_SERVER_FORMAT_FILTER";
16
+ ClientAbrState_MediaType[ClientAbrState_MediaType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
17
+ })(ClientAbrState_MediaType || (ClientAbrState_MediaType = {}));
18
+ export function clientAbrState_MediaTypeFromJSON(object) {
19
+ switch (object) {
20
+ case 0:
21
+ case "MEDIA_TYPE_DEFAULT":
22
+ return ClientAbrState_MediaType.MEDIA_TYPE_DEFAULT;
23
+ case 1:
24
+ case "MEDIA_TYPE_AUDIO":
25
+ return ClientAbrState_MediaType.MEDIA_TYPE_AUDIO;
26
+ case 2:
27
+ case "MEDIA_TYPE_VIDEO":
28
+ return ClientAbrState_MediaType.MEDIA_TYPE_VIDEO;
29
+ case 3:
30
+ case "USE_SERVER_FORMAT_FILTER":
31
+ return ClientAbrState_MediaType.USE_SERVER_FORMAT_FILTER;
32
+ case -1:
33
+ case "UNRECOGNIZED":
34
+ default:
35
+ return ClientAbrState_MediaType.UNRECOGNIZED;
36
+ }
37
+ }
38
+ export function clientAbrState_MediaTypeToJSON(object) {
39
+ switch (object) {
40
+ case ClientAbrState_MediaType.MEDIA_TYPE_DEFAULT:
41
+ return "MEDIA_TYPE_DEFAULT";
42
+ case ClientAbrState_MediaType.MEDIA_TYPE_AUDIO:
43
+ return "MEDIA_TYPE_AUDIO";
44
+ case ClientAbrState_MediaType.MEDIA_TYPE_VIDEO:
45
+ return "MEDIA_TYPE_VIDEO";
46
+ case ClientAbrState_MediaType.USE_SERVER_FORMAT_FILTER:
47
+ return "USE_SERVER_FORMAT_FILTER";
48
+ case ClientAbrState_MediaType.UNRECOGNIZED:
49
+ default:
50
+ return "UNRECOGNIZED";
51
+ }
52
+ }
53
+ function createBaseClientAbrState() {
54
+ return {
55
+ timeSinceLastManualFormatSelectionMs: 0,
56
+ lastManualDirection: 0,
57
+ quality: 0,
58
+ detailedNetworkType: 0,
59
+ maxWidth: 0,
60
+ maxHeight: 0,
61
+ selectedQualityHeight: 0,
62
+ r7: 0,
63
+ startTimeMs: 0,
64
+ timeSinceLastSeek: 0,
65
+ visibility: 0,
66
+ timeSinceLastReq: 0,
67
+ mediaCapabilities: undefined,
68
+ timeSinceLastAction: 0,
69
+ mediaType: 0,
70
+ playerState: 0,
71
+ rangeCompression: false,
72
+ Jda: 0,
73
+ qw: 0,
74
+ Ky: 0,
75
+ sabrReportRequestCancellationInfo: 0,
76
+ l: false,
77
+ G7: 0,
78
+ preferVp9: false,
79
+ qj: 0,
80
+ Hx: 0,
81
+ isPrefetch: false,
82
+ sabrSupportQualityConstraints: 0,
83
+ sabrLicenseConstraint: new Uint8Array(0),
84
+ allowProximaLiveLatency: 0,
85
+ sabrForceProxima: 0,
86
+ Tqb: 0,
87
+ sabrForceMaxNetworkInterruptionDurationMs: 0,
88
+ playbackRate: 0,
89
+ };
90
+ }
91
+ export const ClientAbrState = {
92
+ encode(message, writer = new BinaryWriter()) {
93
+ if (message.timeSinceLastManualFormatSelectionMs !== undefined && message.timeSinceLastManualFormatSelectionMs !== 0) {
94
+ writer.uint32(104).int32(message.timeSinceLastManualFormatSelectionMs);
95
+ }
96
+ if (message.lastManualDirection !== undefined && message.lastManualDirection !== 0) {
97
+ writer.uint32(112).int32(message.lastManualDirection);
98
+ }
99
+ if (message.quality !== undefined && message.quality !== 0) {
100
+ writer.uint32(128).int32(message.quality);
101
+ }
102
+ if (message.detailedNetworkType !== undefined && message.detailedNetworkType !== 0) {
103
+ writer.uint32(136).int32(message.detailedNetworkType);
104
+ }
105
+ if (message.maxWidth !== undefined && message.maxWidth !== 0) {
106
+ writer.uint32(144).int32(message.maxWidth);
107
+ }
108
+ if (message.maxHeight !== undefined && message.maxHeight !== 0) {
109
+ writer.uint32(152).int32(message.maxHeight);
110
+ }
111
+ if (message.selectedQualityHeight !== undefined && message.selectedQualityHeight !== 0) {
112
+ writer.uint32(168).int32(message.selectedQualityHeight);
113
+ }
114
+ if (message.r7 !== undefined && message.r7 !== 0) {
115
+ writer.uint32(184).int32(message.r7);
116
+ }
117
+ if (message.startTimeMs !== undefined && message.startTimeMs !== 0) {
118
+ writer.uint32(224).int64(message.startTimeMs);
119
+ }
120
+ if (message.timeSinceLastSeek !== undefined && message.timeSinceLastSeek !== 0) {
121
+ writer.uint32(232).int64(message.timeSinceLastSeek);
122
+ }
123
+ if (message.visibility !== undefined && message.visibility !== 0) {
124
+ writer.uint32(272).int32(message.visibility);
125
+ }
126
+ if (message.timeSinceLastReq !== undefined && message.timeSinceLastReq !== 0) {
127
+ writer.uint32(288).int64(message.timeSinceLastReq);
128
+ }
129
+ if (message.mediaCapabilities !== undefined) {
130
+ MediaCapabilities.encode(message.mediaCapabilities, writer.uint32(306).fork()).join();
131
+ }
132
+ if (message.timeSinceLastAction !== undefined && message.timeSinceLastAction !== 0) {
133
+ writer.uint32(312).int64(message.timeSinceLastAction);
134
+ }
135
+ if (message.mediaType !== undefined && message.mediaType !== 0) {
136
+ writer.uint32(320).int32(message.mediaType);
137
+ }
138
+ if (message.playerState !== undefined && message.playerState !== 0) {
139
+ writer.uint32(352).int64(message.playerState);
140
+ }
141
+ if (message.rangeCompression !== undefined && message.rangeCompression !== false) {
142
+ writer.uint32(368).bool(message.rangeCompression);
143
+ }
144
+ if (message.Jda !== undefined && message.Jda !== 0) {
145
+ writer.uint32(384).int32(message.Jda);
146
+ }
147
+ if (message.qw !== undefined && message.qw !== 0) {
148
+ writer.uint32(400).int32(message.qw);
149
+ }
150
+ if (message.Ky !== undefined && message.Ky !== 0) {
151
+ writer.uint32(408).int32(message.Ky);
152
+ }
153
+ if (message.sabrReportRequestCancellationInfo !== undefined && message.sabrReportRequestCancellationInfo !== 0) {
154
+ writer.uint32(432).int32(message.sabrReportRequestCancellationInfo);
155
+ }
156
+ if (message.l !== undefined && message.l !== false) {
157
+ writer.uint32(448).bool(message.l);
158
+ }
159
+ if (message.G7 !== undefined && message.G7 !== 0) {
160
+ writer.uint32(456).int64(message.G7);
161
+ }
162
+ if (message.preferVp9 !== undefined && message.preferVp9 !== false) {
163
+ writer.uint32(464).bool(message.preferVp9);
164
+ }
165
+ if (message.qj !== undefined && message.qj !== 0) {
166
+ writer.uint32(472).int32(message.qj);
167
+ }
168
+ if (message.Hx !== undefined && message.Hx !== 0) {
169
+ writer.uint32(480).int32(message.Hx);
170
+ }
171
+ if (message.isPrefetch !== undefined && message.isPrefetch !== false) {
172
+ writer.uint32(488).bool(message.isPrefetch);
173
+ }
174
+ if (message.sabrSupportQualityConstraints !== undefined && message.sabrSupportQualityConstraints !== 0) {
175
+ writer.uint32(496).int32(message.sabrSupportQualityConstraints);
176
+ }
177
+ if (message.sabrLicenseConstraint !== undefined && message.sabrLicenseConstraint.length !== 0) {
178
+ writer.uint32(506).bytes(message.sabrLicenseConstraint);
179
+ }
180
+ if (message.allowProximaLiveLatency !== undefined && message.allowProximaLiveLatency !== 0) {
181
+ writer.uint32(512).int32(message.allowProximaLiveLatency);
182
+ }
183
+ if (message.sabrForceProxima !== undefined && message.sabrForceProxima !== 0) {
184
+ writer.uint32(528).int32(message.sabrForceProxima);
185
+ }
186
+ if (message.Tqb !== undefined && message.Tqb !== 0) {
187
+ writer.uint32(536).int32(message.Tqb);
188
+ }
189
+ if (message.sabrForceMaxNetworkInterruptionDurationMs !== undefined &&
190
+ message.sabrForceMaxNetworkInterruptionDurationMs !== 0) {
191
+ writer.uint32(544).int64(message.sabrForceMaxNetworkInterruptionDurationMs);
192
+ }
193
+ if (message.playbackRate !== undefined && message.playbackRate !== 0) {
194
+ writer.uint32(2285).float(message.playbackRate);
195
+ }
196
+ return writer;
197
+ },
198
+ decode(input, length) {
199
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
200
+ let end = length === undefined ? reader.len : reader.pos + length;
201
+ const message = createBaseClientAbrState();
202
+ while (reader.pos < end) {
203
+ const tag = reader.uint32();
204
+ switch (tag >>> 3) {
205
+ case 13:
206
+ if (tag !== 104) {
207
+ break;
208
+ }
209
+ message.timeSinceLastManualFormatSelectionMs = reader.int32();
210
+ continue;
211
+ case 14:
212
+ if (tag !== 112) {
213
+ break;
214
+ }
215
+ message.lastManualDirection = reader.int32();
216
+ continue;
217
+ case 16:
218
+ if (tag !== 128) {
219
+ break;
220
+ }
221
+ message.quality = reader.int32();
222
+ continue;
223
+ case 17:
224
+ if (tag !== 136) {
225
+ break;
226
+ }
227
+ message.detailedNetworkType = reader.int32();
228
+ continue;
229
+ case 18:
230
+ if (tag !== 144) {
231
+ break;
232
+ }
233
+ message.maxWidth = reader.int32();
234
+ continue;
235
+ case 19:
236
+ if (tag !== 152) {
237
+ break;
238
+ }
239
+ message.maxHeight = reader.int32();
240
+ continue;
241
+ case 21:
242
+ if (tag !== 168) {
243
+ break;
244
+ }
245
+ message.selectedQualityHeight = reader.int32();
246
+ continue;
247
+ case 23:
248
+ if (tag !== 184) {
249
+ break;
250
+ }
251
+ message.r7 = reader.int32();
252
+ continue;
253
+ case 28:
254
+ if (tag !== 224) {
255
+ break;
256
+ }
257
+ message.startTimeMs = longToNumber(reader.int64());
258
+ continue;
259
+ case 29:
260
+ if (tag !== 232) {
261
+ break;
262
+ }
263
+ message.timeSinceLastSeek = longToNumber(reader.int64());
264
+ continue;
265
+ case 34:
266
+ if (tag !== 272) {
267
+ break;
268
+ }
269
+ message.visibility = reader.int32();
270
+ continue;
271
+ case 36:
272
+ if (tag !== 288) {
273
+ break;
274
+ }
275
+ message.timeSinceLastReq = longToNumber(reader.int64());
276
+ continue;
277
+ case 38:
278
+ if (tag !== 306) {
279
+ break;
280
+ }
281
+ message.mediaCapabilities = MediaCapabilities.decode(reader, reader.uint32());
282
+ continue;
283
+ case 39:
284
+ if (tag !== 312) {
285
+ break;
286
+ }
287
+ message.timeSinceLastAction = longToNumber(reader.int64());
288
+ continue;
289
+ case 40:
290
+ if (tag !== 320) {
291
+ break;
292
+ }
293
+ message.mediaType = reader.int32();
294
+ continue;
295
+ case 44:
296
+ if (tag !== 352) {
297
+ break;
298
+ }
299
+ message.playerState = longToNumber(reader.int64());
300
+ continue;
301
+ case 46:
302
+ if (tag !== 368) {
303
+ break;
304
+ }
305
+ message.rangeCompression = reader.bool();
306
+ continue;
307
+ case 48:
308
+ if (tag !== 384) {
309
+ break;
310
+ }
311
+ message.Jda = reader.int32();
312
+ continue;
313
+ case 50:
314
+ if (tag !== 400) {
315
+ break;
316
+ }
317
+ message.qw = reader.int32();
318
+ continue;
319
+ case 51:
320
+ if (tag !== 408) {
321
+ break;
322
+ }
323
+ message.Ky = reader.int32();
324
+ continue;
325
+ case 54:
326
+ if (tag !== 432) {
327
+ break;
328
+ }
329
+ message.sabrReportRequestCancellationInfo = reader.int32();
330
+ continue;
331
+ case 56:
332
+ if (tag !== 448) {
333
+ break;
334
+ }
335
+ message.l = reader.bool();
336
+ continue;
337
+ case 57:
338
+ if (tag !== 456) {
339
+ break;
340
+ }
341
+ message.G7 = longToNumber(reader.int64());
342
+ continue;
343
+ case 58:
344
+ if (tag !== 464) {
345
+ break;
346
+ }
347
+ message.preferVp9 = reader.bool();
348
+ continue;
349
+ case 59:
350
+ if (tag !== 472) {
351
+ break;
352
+ }
353
+ message.qj = reader.int32();
354
+ continue;
355
+ case 60:
356
+ if (tag !== 480) {
357
+ break;
358
+ }
359
+ message.Hx = reader.int32();
360
+ continue;
361
+ case 61:
362
+ if (tag !== 488) {
363
+ break;
364
+ }
365
+ message.isPrefetch = reader.bool();
366
+ continue;
367
+ case 62:
368
+ if (tag !== 496) {
369
+ break;
370
+ }
371
+ message.sabrSupportQualityConstraints = reader.int32();
372
+ continue;
373
+ case 63:
374
+ if (tag !== 506) {
375
+ break;
376
+ }
377
+ message.sabrLicenseConstraint = reader.bytes();
378
+ continue;
379
+ case 64:
380
+ if (tag !== 512) {
381
+ break;
382
+ }
383
+ message.allowProximaLiveLatency = reader.int32();
384
+ continue;
385
+ case 66:
386
+ if (tag !== 528) {
387
+ break;
388
+ }
389
+ message.sabrForceProxima = reader.int32();
390
+ continue;
391
+ case 67:
392
+ if (tag !== 536) {
393
+ break;
394
+ }
395
+ message.Tqb = reader.int32();
396
+ continue;
397
+ case 68:
398
+ if (tag !== 544) {
399
+ break;
400
+ }
401
+ message.sabrForceMaxNetworkInterruptionDurationMs = longToNumber(reader.int64());
402
+ continue;
403
+ case 285:
404
+ if (tag !== 2285) {
405
+ break;
406
+ }
407
+ message.playbackRate = reader.float();
408
+ continue;
409
+ }
410
+ if ((tag & 7) === 4 || tag === 0) {
411
+ break;
412
+ }
413
+ reader.skip(tag & 7);
414
+ }
415
+ return message;
416
+ },
417
+ fromJSON(object) {
418
+ return {
419
+ timeSinceLastManualFormatSelectionMs: isSet(object.timeSinceLastManualFormatSelectionMs)
420
+ ? globalThis.Number(object.timeSinceLastManualFormatSelectionMs)
421
+ : 0,
422
+ lastManualDirection: isSet(object.lastManualDirection) ? globalThis.Number(object.lastManualDirection) : 0,
423
+ quality: isSet(object.quality) ? globalThis.Number(object.quality) : 0,
424
+ detailedNetworkType: isSet(object.detailedNetworkType) ? globalThis.Number(object.detailedNetworkType) : 0,
425
+ maxWidth: isSet(object.maxWidth) ? globalThis.Number(object.maxWidth) : 0,
426
+ maxHeight: isSet(object.maxHeight) ? globalThis.Number(object.maxHeight) : 0,
427
+ selectedQualityHeight: isSet(object.selectedQualityHeight) ? globalThis.Number(object.selectedQualityHeight) : 0,
428
+ r7: isSet(object.r7) ? globalThis.Number(object.r7) : 0,
429
+ startTimeMs: isSet(object.startTimeMs) ? globalThis.Number(object.startTimeMs) : 0,
430
+ timeSinceLastSeek: isSet(object.timeSinceLastSeek) ? globalThis.Number(object.timeSinceLastSeek) : 0,
431
+ visibility: isSet(object.visibility) ? globalThis.Number(object.visibility) : 0,
432
+ timeSinceLastReq: isSet(object.timeSinceLastReq) ? globalThis.Number(object.timeSinceLastReq) : 0,
433
+ mediaCapabilities: isSet(object.mediaCapabilities)
434
+ ? MediaCapabilities.fromJSON(object.mediaCapabilities)
435
+ : undefined,
436
+ timeSinceLastAction: isSet(object.timeSinceLastAction) ? globalThis.Number(object.timeSinceLastAction) : 0,
437
+ mediaType: isSet(object.mediaType) ? clientAbrState_MediaTypeFromJSON(object.mediaType) : 0,
438
+ playerState: isSet(object.playerState) ? globalThis.Number(object.playerState) : 0,
439
+ rangeCompression: isSet(object.rangeCompression) ? globalThis.Boolean(object.rangeCompression) : false,
440
+ Jda: isSet(object.Jda) ? globalThis.Number(object.Jda) : 0,
441
+ qw: isSet(object.qw) ? globalThis.Number(object.qw) : 0,
442
+ Ky: isSet(object.Ky) ? globalThis.Number(object.Ky) : 0,
443
+ sabrReportRequestCancellationInfo: isSet(object.sabrReportRequestCancellationInfo)
444
+ ? globalThis.Number(object.sabrReportRequestCancellationInfo)
445
+ : 0,
446
+ l: isSet(object.l) ? globalThis.Boolean(object.l) : false,
447
+ G7: isSet(object.G7) ? globalThis.Number(object.G7) : 0,
448
+ preferVp9: isSet(object.preferVp9) ? globalThis.Boolean(object.preferVp9) : false,
449
+ qj: isSet(object.qj) ? globalThis.Number(object.qj) : 0,
450
+ Hx: isSet(object.Hx) ? globalThis.Number(object.Hx) : 0,
451
+ isPrefetch: isSet(object.isPrefetch) ? globalThis.Boolean(object.isPrefetch) : false,
452
+ sabrSupportQualityConstraints: isSet(object.sabrSupportQualityConstraints)
453
+ ? globalThis.Number(object.sabrSupportQualityConstraints)
454
+ : 0,
455
+ sabrLicenseConstraint: isSet(object.sabrLicenseConstraint)
456
+ ? bytesFromBase64(object.sabrLicenseConstraint)
457
+ : new Uint8Array(0),
458
+ allowProximaLiveLatency: isSet(object.allowProximaLiveLatency)
459
+ ? globalThis.Number(object.allowProximaLiveLatency)
460
+ : 0,
461
+ sabrForceProxima: isSet(object.sabrForceProxima) ? globalThis.Number(object.sabrForceProxima) : 0,
462
+ Tqb: isSet(object.Tqb) ? globalThis.Number(object.Tqb) : 0,
463
+ sabrForceMaxNetworkInterruptionDurationMs: isSet(object.sabrForceMaxNetworkInterruptionDurationMs)
464
+ ? globalThis.Number(object.sabrForceMaxNetworkInterruptionDurationMs)
465
+ : 0,
466
+ playbackRate: isSet(object.playbackRate) ? globalThis.Number(object.playbackRate) : 0,
467
+ };
468
+ },
469
+ toJSON(message) {
470
+ const obj = {};
471
+ if (message.timeSinceLastManualFormatSelectionMs !== undefined && message.timeSinceLastManualFormatSelectionMs !== 0) {
472
+ obj.timeSinceLastManualFormatSelectionMs = Math.round(message.timeSinceLastManualFormatSelectionMs);
473
+ }
474
+ if (message.lastManualDirection !== undefined && message.lastManualDirection !== 0) {
475
+ obj.lastManualDirection = Math.round(message.lastManualDirection);
476
+ }
477
+ if (message.quality !== undefined && message.quality !== 0) {
478
+ obj.quality = Math.round(message.quality);
479
+ }
480
+ if (message.detailedNetworkType !== undefined && message.detailedNetworkType !== 0) {
481
+ obj.detailedNetworkType = Math.round(message.detailedNetworkType);
482
+ }
483
+ if (message.maxWidth !== undefined && message.maxWidth !== 0) {
484
+ obj.maxWidth = Math.round(message.maxWidth);
485
+ }
486
+ if (message.maxHeight !== undefined && message.maxHeight !== 0) {
487
+ obj.maxHeight = Math.round(message.maxHeight);
488
+ }
489
+ if (message.selectedQualityHeight !== undefined && message.selectedQualityHeight !== 0) {
490
+ obj.selectedQualityHeight = Math.round(message.selectedQualityHeight);
491
+ }
492
+ if (message.r7 !== undefined && message.r7 !== 0) {
493
+ obj.r7 = Math.round(message.r7);
494
+ }
495
+ if (message.startTimeMs !== undefined && message.startTimeMs !== 0) {
496
+ obj.startTimeMs = Math.round(message.startTimeMs);
497
+ }
498
+ if (message.timeSinceLastSeek !== undefined && message.timeSinceLastSeek !== 0) {
499
+ obj.timeSinceLastSeek = Math.round(message.timeSinceLastSeek);
500
+ }
501
+ if (message.visibility !== undefined && message.visibility !== 0) {
502
+ obj.visibility = Math.round(message.visibility);
503
+ }
504
+ if (message.timeSinceLastReq !== undefined && message.timeSinceLastReq !== 0) {
505
+ obj.timeSinceLastReq = Math.round(message.timeSinceLastReq);
506
+ }
507
+ if (message.mediaCapabilities !== undefined) {
508
+ obj.mediaCapabilities = MediaCapabilities.toJSON(message.mediaCapabilities);
509
+ }
510
+ if (message.timeSinceLastAction !== undefined && message.timeSinceLastAction !== 0) {
511
+ obj.timeSinceLastAction = Math.round(message.timeSinceLastAction);
512
+ }
513
+ if (message.mediaType !== undefined && message.mediaType !== 0) {
514
+ obj.mediaType = clientAbrState_MediaTypeToJSON(message.mediaType);
515
+ }
516
+ if (message.playerState !== undefined && message.playerState !== 0) {
517
+ obj.playerState = Math.round(message.playerState);
518
+ }
519
+ if (message.rangeCompression !== undefined && message.rangeCompression !== false) {
520
+ obj.rangeCompression = message.rangeCompression;
521
+ }
522
+ if (message.Jda !== undefined && message.Jda !== 0) {
523
+ obj.Jda = Math.round(message.Jda);
524
+ }
525
+ if (message.qw !== undefined && message.qw !== 0) {
526
+ obj.qw = Math.round(message.qw);
527
+ }
528
+ if (message.Ky !== undefined && message.Ky !== 0) {
529
+ obj.Ky = Math.round(message.Ky);
530
+ }
531
+ if (message.sabrReportRequestCancellationInfo !== undefined && message.sabrReportRequestCancellationInfo !== 0) {
532
+ obj.sabrReportRequestCancellationInfo = Math.round(message.sabrReportRequestCancellationInfo);
533
+ }
534
+ if (message.l !== undefined && message.l !== false) {
535
+ obj.l = message.l;
536
+ }
537
+ if (message.G7 !== undefined && message.G7 !== 0) {
538
+ obj.G7 = Math.round(message.G7);
539
+ }
540
+ if (message.preferVp9 !== undefined && message.preferVp9 !== false) {
541
+ obj.preferVp9 = message.preferVp9;
542
+ }
543
+ if (message.qj !== undefined && message.qj !== 0) {
544
+ obj.qj = Math.round(message.qj);
545
+ }
546
+ if (message.Hx !== undefined && message.Hx !== 0) {
547
+ obj.Hx = Math.round(message.Hx);
548
+ }
549
+ if (message.isPrefetch !== undefined && message.isPrefetch !== false) {
550
+ obj.isPrefetch = message.isPrefetch;
551
+ }
552
+ if (message.sabrSupportQualityConstraints !== undefined && message.sabrSupportQualityConstraints !== 0) {
553
+ obj.sabrSupportQualityConstraints = Math.round(message.sabrSupportQualityConstraints);
554
+ }
555
+ if (message.sabrLicenseConstraint !== undefined && message.sabrLicenseConstraint.length !== 0) {
556
+ obj.sabrLicenseConstraint = base64FromBytes(message.sabrLicenseConstraint);
557
+ }
558
+ if (message.allowProximaLiveLatency !== undefined && message.allowProximaLiveLatency !== 0) {
559
+ obj.allowProximaLiveLatency = Math.round(message.allowProximaLiveLatency);
560
+ }
561
+ if (message.sabrForceProxima !== undefined && message.sabrForceProxima !== 0) {
562
+ obj.sabrForceProxima = Math.round(message.sabrForceProxima);
563
+ }
564
+ if (message.Tqb !== undefined && message.Tqb !== 0) {
565
+ obj.Tqb = Math.round(message.Tqb);
566
+ }
567
+ if (message.sabrForceMaxNetworkInterruptionDurationMs !== undefined &&
568
+ message.sabrForceMaxNetworkInterruptionDurationMs !== 0) {
569
+ obj.sabrForceMaxNetworkInterruptionDurationMs = Math.round(message.sabrForceMaxNetworkInterruptionDurationMs);
570
+ }
571
+ if (message.playbackRate !== undefined && message.playbackRate !== 0) {
572
+ obj.playbackRate = message.playbackRate;
573
+ }
574
+ return obj;
575
+ },
576
+ create(base) {
577
+ return ClientAbrState.fromPartial(base ?? {});
578
+ },
579
+ fromPartial(object) {
580
+ const message = createBaseClientAbrState();
581
+ message.timeSinceLastManualFormatSelectionMs = object.timeSinceLastManualFormatSelectionMs ?? 0;
582
+ message.lastManualDirection = object.lastManualDirection ?? 0;
583
+ message.quality = object.quality ?? 0;
584
+ message.detailedNetworkType = object.detailedNetworkType ?? 0;
585
+ message.maxWidth = object.maxWidth ?? 0;
586
+ message.maxHeight = object.maxHeight ?? 0;
587
+ message.selectedQualityHeight = object.selectedQualityHeight ?? 0;
588
+ message.r7 = object.r7 ?? 0;
589
+ message.startTimeMs = object.startTimeMs ?? 0;
590
+ message.timeSinceLastSeek = object.timeSinceLastSeek ?? 0;
591
+ message.visibility = object.visibility ?? 0;
592
+ message.timeSinceLastReq = object.timeSinceLastReq ?? 0;
593
+ message.mediaCapabilities = (object.mediaCapabilities !== undefined && object.mediaCapabilities !== null)
594
+ ? MediaCapabilities.fromPartial(object.mediaCapabilities)
595
+ : undefined;
596
+ message.timeSinceLastAction = object.timeSinceLastAction ?? 0;
597
+ message.mediaType = object.mediaType ?? 0;
598
+ message.playerState = object.playerState ?? 0;
599
+ message.rangeCompression = object.rangeCompression ?? false;
600
+ message.Jda = object.Jda ?? 0;
601
+ message.qw = object.qw ?? 0;
602
+ message.Ky = object.Ky ?? 0;
603
+ message.sabrReportRequestCancellationInfo = object.sabrReportRequestCancellationInfo ?? 0;
604
+ message.l = object.l ?? false;
605
+ message.G7 = object.G7 ?? 0;
606
+ message.preferVp9 = object.preferVp9 ?? false;
607
+ message.qj = object.qj ?? 0;
608
+ message.Hx = object.Hx ?? 0;
609
+ message.isPrefetch = object.isPrefetch ?? false;
610
+ message.sabrSupportQualityConstraints = object.sabrSupportQualityConstraints ?? 0;
611
+ message.sabrLicenseConstraint = object.sabrLicenseConstraint ?? new Uint8Array(0);
612
+ message.allowProximaLiveLatency = object.allowProximaLiveLatency ?? 0;
613
+ message.sabrForceProxima = object.sabrForceProxima ?? 0;
614
+ message.Tqb = object.Tqb ?? 0;
615
+ message.sabrForceMaxNetworkInterruptionDurationMs = object.sabrForceMaxNetworkInterruptionDurationMs ?? 0;
616
+ message.playbackRate = object.playbackRate ?? 0;
617
+ return message;
618
+ },
619
+ };
620
+ function bytesFromBase64(b64) {
621
+ const bin = globalThis.atob(b64);
622
+ const arr = new Uint8Array(bin.length);
623
+ for (let i = 0; i < bin.length; ++i) {
624
+ arr[i] = bin.charCodeAt(i);
625
+ }
626
+ return arr;
627
+ }
628
+ function base64FromBytes(arr) {
629
+ const bin = [];
630
+ arr.forEach((byte) => {
631
+ bin.push(globalThis.String.fromCharCode(byte));
632
+ });
633
+ return globalThis.btoa(bin.join(""));
634
+ }
635
+ function longToNumber(int64) {
636
+ const num = globalThis.Number(int64.toString());
637
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
638
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
639
+ }
640
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
641
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
642
+ }
643
+ return num;
644
+ }
645
+ function isSet(value) {
646
+ return value !== null && value !== undefined;
647
+ }
@@ -0,0 +1,35 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "video_streaming";
3
+ export interface CryptoParams {
4
+ hmac?: Uint8Array | undefined;
5
+ iv?: Uint8Array | undefined;
6
+ compressionType?: CryptoParams_CompressionType | undefined;
7
+ }
8
+ export declare enum CryptoParams_CompressionType {
9
+ VAL_0 = 0,
10
+ VAL_1 = 1,
11
+ VAL_2 = 2,
12
+ UNRECOGNIZED = -1
13
+ }
14
+ export declare function cryptoParams_CompressionTypeFromJSON(object: any): CryptoParams_CompressionType;
15
+ export declare function cryptoParams_CompressionTypeToJSON(object: CryptoParams_CompressionType): string;
16
+ export declare const CryptoParams: MessageFns<CryptoParams>;
17
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
18
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
19
+ [K in keyof T]?: DeepPartial<T[K]>;
20
+ } : Partial<T>;
21
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
22
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
23
+ [K in keyof P]: Exact<P[K], I[K]>;
24
+ } & {
25
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
26
+ };
27
+ export interface MessageFns<T> {
28
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
29
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
30
+ fromJSON(object: any): T;
31
+ toJSON(message: T): unknown;
32
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
33
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
34
+ }
35
+ export {};