@reactor-team/js-sdk 3.0.0 → 3.0.2
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 +100 -133
- package/dist/index.cjs +264 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -9
- package/dist/index.d.ts +82 -9
- package/dist/index.js +264 -39
- package/dist/index.js.map +1 -1
- package/dist/wasm/reactor_wasm.d.ts +20 -3
- package/dist/wasm/reactor_wasm.js +58 -14
- package/dist/wasm/reactor_wasm_bg.wasm +0 -0
- package/dist/wasm/reactor_wasm_bg.wasm.d.ts +4 -3
- package/package.json +1 -1
|
@@ -317,6 +317,22 @@ export class ReactorClient {
|
|
|
317
317
|
* how a client built before sign-in gets its token.
|
|
318
318
|
*/
|
|
319
319
|
setJwt(jwt?: JwtSource | null): void;
|
|
320
|
+
/**
|
|
321
|
+
* Bound what one sender may spend, in bits per second. `undefined` or a
|
|
322
|
+
* negative value leaves a bound at the browser default.
|
|
323
|
+
*
|
|
324
|
+
* This is the ceiling that actually caps a video encoder. With nothing set,
|
|
325
|
+
* a Chromium-based browser derives a maximum from the frame size alone, and
|
|
326
|
+
* that maximum is 2500 kbps for anything above 960x540 — so 720p and 1080p
|
|
327
|
+
* senders cap at 2.5 Mbps until this raises them.
|
|
328
|
+
*
|
|
329
|
+
* `minBps` is non-standard: Chromium honours it, other engines ignore it.
|
|
330
|
+
*
|
|
331
|
+
* There is deliberately no connection-wide counterpart. The browser exposes
|
|
332
|
+
* no equivalent of libwebrtc's `PeerConnection::SetBitrate`, and a method
|
|
333
|
+
* that quietly did nothing would be worse than its absence.
|
|
334
|
+
*/
|
|
335
|
+
setTrackBitrate(name: string, min_bps?: number | null, max_bps?: number | null): Promise<void>;
|
|
320
336
|
/**
|
|
321
337
|
* `"disconnected"` | `"connecting"` | `"waiting"` | `"ready"`.
|
|
322
338
|
*/
|
|
@@ -377,6 +393,7 @@ export interface InitOutput {
|
|
|
377
393
|
readonly reactorclient_sessionId: (a: number) => [number, number];
|
|
378
394
|
readonly reactorclient_sessionInfo: (a: number) => [number, number, number];
|
|
379
395
|
readonly reactorclient_setJwt: (a: number, b: number) => [number, number];
|
|
396
|
+
readonly reactorclient_setTrackBitrate: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
380
397
|
readonly reactorclient_status: (a: number) => any;
|
|
381
398
|
readonly reactorclient_trackMapping: (a: number) => [number, number, number];
|
|
382
399
|
readonly reactorclient_tracks: (a: number) => [number, number, number];
|
|
@@ -384,9 +401,9 @@ export interface InitOutput {
|
|
|
384
401
|
readonly reactorclient_uploadFile: (a: number, b: any, c: number, d: number) => any;
|
|
385
402
|
readonly wasm_bindgen_85f920685b213f97___convert__closures_____invoke___wasm_bindgen_85f920685b213f97___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_85f920685b213f97___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
386
403
|
readonly wasm_bindgen_85f920685b213f97___convert__closures_____invoke___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
387
|
-
readonly
|
|
388
|
-
readonly
|
|
389
|
-
readonly
|
|
404
|
+
readonly wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true_: (a: number, b: number, c: any) => void;
|
|
405
|
+
readonly wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__2: (a: number, b: number, c: any) => void;
|
|
406
|
+
readonly wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__3: (a: number, b: number, c: any) => void;
|
|
390
407
|
readonly wasm_bindgen_85f920685b213f97___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
391
408
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
392
409
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -336,6 +336,31 @@ export class ReactorClient {
|
|
|
336
336
|
throw takeFromExternrefTable0(ret[0]);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* Bound what one sender may spend, in bits per second. `undefined` or a
|
|
341
|
+
* negative value leaves a bound at the browser default.
|
|
342
|
+
*
|
|
343
|
+
* This is the ceiling that actually caps a video encoder. With nothing set,
|
|
344
|
+
* a Chromium-based browser derives a maximum from the frame size alone, and
|
|
345
|
+
* that maximum is 2500 kbps for anything above 960x540 — so 720p and 1080p
|
|
346
|
+
* senders cap at 2.5 Mbps until this raises them.
|
|
347
|
+
*
|
|
348
|
+
* `minBps` is non-standard: Chromium honours it, other engines ignore it.
|
|
349
|
+
*
|
|
350
|
+
* There is deliberately no connection-wide counterpart. The browser exposes
|
|
351
|
+
* no equivalent of libwebrtc's `PeerConnection::SetBitrate`, and a method
|
|
352
|
+
* that quietly did nothing would be worse than its absence.
|
|
353
|
+
* @param {string} name
|
|
354
|
+
* @param {number | null} [min_bps]
|
|
355
|
+
* @param {number | null} [max_bps]
|
|
356
|
+
* @returns {Promise<void>}
|
|
357
|
+
*/
|
|
358
|
+
setTrackBitrate(name, min_bps, max_bps) {
|
|
359
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
360
|
+
const len0 = WASM_VECTOR_LEN;
|
|
361
|
+
const ret = wasm.reactorclient_setTrackBitrate(this.__wbg_ptr, ptr0, len0, isLikeNone(min_bps) ? Number.MAX_SAFE_INTEGER : (min_bps) >> 0, isLikeNone(max_bps) ? Number.MAX_SAFE_INTEGER : (max_bps) >> 0);
|
|
362
|
+
return ret;
|
|
363
|
+
}
|
|
339
364
|
/**
|
|
340
365
|
* `"disconnected"` | `"connecting"` | `"waiting"` | `"ready"`.
|
|
341
366
|
* @returns {ReactorStatus}
|
|
@@ -556,6 +581,10 @@ function __wbg_get_imports() {
|
|
|
556
581
|
__wbg_debug_87fd9b1a625b7efb: function(arg0) {
|
|
557
582
|
console.debug(arg0);
|
|
558
583
|
},
|
|
584
|
+
__wbg_deleteProperty_36be13e7a282429c: function() { return handleError(function (arg0, arg1) {
|
|
585
|
+
const ret = Reflect.deleteProperty(arg0, arg1);
|
|
586
|
+
return ret;
|
|
587
|
+
}, arguments); },
|
|
559
588
|
__wbg_done_89b2b13e91a60321: function(arg0) {
|
|
560
589
|
const ret = arg0.done;
|
|
561
590
|
return ret;
|
|
@@ -575,6 +604,10 @@ function __wbg_get_imports() {
|
|
|
575
604
|
const ret = arg0.fetch(arg1);
|
|
576
605
|
return ret;
|
|
577
606
|
},
|
|
607
|
+
__wbg_getParameters_b0f02b61e4b42a6e: function(arg0) {
|
|
608
|
+
const ret = arg0.getParameters();
|
|
609
|
+
return ret;
|
|
610
|
+
},
|
|
578
611
|
__wbg_get_507a50627bffa49b: function(arg0, arg1) {
|
|
579
612
|
const ret = arg0[arg1 >>> 0];
|
|
580
613
|
return ret;
|
|
@@ -855,6 +888,10 @@ function __wbg_get_imports() {
|
|
|
855
888
|
__wbg_queueMicrotask_6a09b7bc46549209: function(arg0) {
|
|
856
889
|
queueMicrotask(arg0);
|
|
857
890
|
},
|
|
891
|
+
__wbg_readyState_26ebdcb846c7e00d: function(arg0) {
|
|
892
|
+
const ret = arg0.readyState;
|
|
893
|
+
return (__wbindgen_enum_RtcDataChannelState.indexOf(ret) + 1 || 5) - 1;
|
|
894
|
+
},
|
|
858
895
|
__wbg_replaceTrack_19163bddac4709c8: function(arg0, arg1) {
|
|
859
896
|
const ret = arg0.replaceTrack(arg1);
|
|
860
897
|
return ret;
|
|
@@ -888,6 +925,10 @@ function __wbg_get_imports() {
|
|
|
888
925
|
const ret = arg0.setLocalDescription(arg1);
|
|
889
926
|
return ret;
|
|
890
927
|
},
|
|
928
|
+
__wbg_setParameters_03d847864c0523f3: function(arg0, arg1) {
|
|
929
|
+
const ret = arg0.setParameters(arg1);
|
|
930
|
+
return ret;
|
|
931
|
+
},
|
|
891
932
|
__wbg_setRemoteDescription_921ff9a4233c90c7: function(arg0, arg1) {
|
|
892
933
|
const ret = arg0.setRemoteDescription(arg1);
|
|
893
934
|
return ret;
|
|
@@ -1018,27 +1059,27 @@ function __wbg_get_imports() {
|
|
|
1018
1059
|
console.warn(arg0);
|
|
1019
1060
|
},
|
|
1020
1061
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1021
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1062
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 291, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1022
1063
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke___wasm_bindgen_85f920685b213f97___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_85f920685b213f97___JsError___true_);
|
|
1023
1064
|
return ret;
|
|
1024
1065
|
},
|
|
1025
1066
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1026
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx:
|
|
1027
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1067
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 208, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1068
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true_);
|
|
1028
1069
|
return ret;
|
|
1029
1070
|
},
|
|
1030
1071
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1031
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("RTCPeerConnectionIceEvent")], shim_idx:
|
|
1032
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1072
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("RTCPeerConnectionIceEvent")], shim_idx: 208, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1073
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__2);
|
|
1033
1074
|
return ret;
|
|
1034
1075
|
},
|
|
1035
1076
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
1036
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("RTCTrackEvent")], shim_idx:
|
|
1037
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1077
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("RTCTrackEvent")], shim_idx: 208, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1078
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__3);
|
|
1038
1079
|
return ret;
|
|
1039
1080
|
},
|
|
1040
1081
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
1041
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1082
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 212, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1042
1083
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_85f920685b213f97___convert__closures_____invoke_______true_);
|
|
1043
1084
|
return ret;
|
|
1044
1085
|
},
|
|
@@ -1082,16 +1123,16 @@ function wasm_bindgen_85f920685b213f97___convert__closures_____invoke_______true
|
|
|
1082
1123
|
wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke_______true_(arg0, arg1);
|
|
1083
1124
|
}
|
|
1084
1125
|
|
|
1085
|
-
function
|
|
1086
|
-
wasm.
|
|
1126
|
+
function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true_(arg0, arg1, arg2) {
|
|
1127
|
+
wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true_(arg0, arg1, arg2);
|
|
1087
1128
|
}
|
|
1088
1129
|
|
|
1089
|
-
function
|
|
1090
|
-
wasm.
|
|
1130
|
+
function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__2(arg0, arg1, arg2) {
|
|
1131
|
+
wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__2(arg0, arg1, arg2);
|
|
1091
1132
|
}
|
|
1092
1133
|
|
|
1093
|
-
function
|
|
1094
|
-
wasm.
|
|
1134
|
+
function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__3(arg0, arg1, arg2) {
|
|
1135
|
+
wasm.wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__3(arg0, arg1, arg2);
|
|
1095
1136
|
}
|
|
1096
1137
|
|
|
1097
1138
|
function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___wasm_bindgen_85f920685b213f97___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_85f920685b213f97___JsError___true_(arg0, arg1, arg2) {
|
|
@@ -1106,6 +1147,9 @@ function wasm_bindgen_85f920685b213f97___convert__closures_____invoke___js_sys_1
|
|
|
1106
1147
|
}
|
|
1107
1148
|
|
|
1108
1149
|
|
|
1150
|
+
const __wbindgen_enum_RtcDataChannelState = ["connecting", "open", "closing", "closed"];
|
|
1151
|
+
|
|
1152
|
+
|
|
1109
1153
|
const __wbindgen_enum_RtcDataChannelType = ["arraybuffer", "blob"];
|
|
1110
1154
|
|
|
1111
1155
|
|
|
Binary file
|
|
@@ -31,6 +31,7 @@ export const reactorclient_sendCommand: (a: number, b: number, c: number, d: num
|
|
|
31
31
|
export const reactorclient_sessionId: (a: number) => [number, number];
|
|
32
32
|
export const reactorclient_sessionInfo: (a: number) => [number, number, number];
|
|
33
33
|
export const reactorclient_setJwt: (a: number, b: number) => [number, number];
|
|
34
|
+
export const reactorclient_setTrackBitrate: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
34
35
|
export const reactorclient_status: (a: number) => any;
|
|
35
36
|
export const reactorclient_trackMapping: (a: number) => [number, number, number];
|
|
36
37
|
export const reactorclient_tracks: (a: number) => [number, number, number];
|
|
@@ -38,9 +39,9 @@ export const reactorclient_unpublishTrack: (a: number, b: number, c: number) =>
|
|
|
38
39
|
export const reactorclient_uploadFile: (a: number, b: any, c: number, d: number) => any;
|
|
39
40
|
export const wasm_bindgen_85f920685b213f97___convert__closures_____invoke___wasm_bindgen_85f920685b213f97___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_85f920685b213f97___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
40
41
|
export const wasm_bindgen_85f920685b213f97___convert__closures_____invoke___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined___js_sys_17f5e83adf9a2bda___Function_fn_wasm_bindgen_85f920685b213f97___JsValue_____wasm_bindgen_85f920685b213f97___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
42
|
+
export const wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true_: (a: number, b: number, c: any) => void;
|
|
43
|
+
export const wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__2: (a: number, b: number, c: any) => void;
|
|
44
|
+
export const wasm_bindgen_85f920685b213f97___convert__closures_____invoke___web_sys_9b25b1d5883c10fa___features__gen_MessageEvent__MessageEvent______true__3: (a: number, b: number, c: any) => void;
|
|
44
45
|
export const wasm_bindgen_85f920685b213f97___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
45
46
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
46
47
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|