@3dsource/angular-unreal-module 0.0.145 → 0.0.146-dev.1
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/LICENSE +14 -14
- package/README.md +361 -370
- package/fesm2022/3dsource-angular-unreal-module.mjs +337 -140
- package/fesm2022/3dsource-angular-unreal-module.mjs.map +1 -1
- package/js/stream-prefetch.js +4 -0
- package/package.json +1 -1
- package/types/3dsource-angular-unreal-module.d.ts +134 -35
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";(()=>{"use strict";const f="metabox-configurator",m=/metabox-configurator\/(modular|basic)\/([^/?#]+)/i,g="3dsource:region-ping",w="assets/config.json",k="42e01f";function h(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const e=Math.random()*16|0;return(o==="x"?e:e&3|8).toString(16)})}function I(o){return o.replace("http://","ws://").replace("https://","wss://")}const l="[stream-prefetch]",s=(...o)=>console.log(l,...o),c=(...o)=>console.warn(l,...o),u=(...o)=>console.error(l,...o);class y{constructor(){const e=document.currentScript||(()=>{const n=document.getElementsByTagName("script");return n[n.length-1]})(),t=e&&e.dataset||{};this.configUrl=t.configUrl||w,this.fallbackPollingUrl=t.fallbackUrl||"",this.skipRouteCheck=this.boolOr(t.skipRouteCheck,!1),this.config={watchdog_ms:this.numberOr(t.watchdogMs,15e3),ws_timeout:this.numberOr(t.wsTimeout,6e3),poll_timeout:this.numberOr(t.pollTimeout,4e3)};const i=new URLSearchParams(window.location.search);this.forceTURN=i.has("ForceTURN"),this.forceMaxBundle=i.has("ForceMaxBundle"),this.forceMonoAudio=i.has("forceMono"),this.ids={clientId:h(),viewId:h(),correlationId:h()},this.context=null,this.environmentId=void 0,this.orchestrationType="",this.region="",this.requireEnvironmentId=!0,this.pc=null,this.dc=null,this.stream=null,this.ws=null,this.remoteDescriptionSet=!1,this.iceBuffer=[],this.watchdogId=null,this.wsTimeoutId=null,this.settled=!1}run(){if(typeof window=="undefined"||!("WebSocket"in window)||!("RTCPeerConnection"in window))return;if(this.skipRouteCheck){this.context={},this.requireEnvironmentId=!1,c("skipRouteCheck=true \u2014 ignoring URL gate, route, context and environmentId; using fallback polling"),this.publishParked("connecting"),this.connect().catch(t=>this.fail("exception",t));return}if(window.location.href.indexOf(f)===-1){s("skip \u2014 URL does not contain gate",`"${f}"`);return}const e=this.parseConfiguratorUrl();e?(this.context={id:e.contextId,data:{configuratorId:e.configuratorId}},this.requireEnvironmentId=!0,s("start",{contextId:e.contextId,configuratorId:e.configuratorId,ids:this.ids})):(this.context={},this.requireEnvironmentId=!1,c("URL is not a configurator route \u2014 prefetching with empty context {} and no required environmentId",window.location.pathname)),this.publishParked("connecting"),this.connect().catch(t=>this.fail("exception",t))}parseConfiguratorUrl(){const e=window.location.pathname.match(m);return e?{contextId:e[1].toLowerCase()==="modular"?"metaboxModularConfigurator":"metaboxBasicConfigurator",configuratorId:decodeURIComponent(e[2])}:null}connect(){return this.mark("prefetch_start"),this.region=this.readRegion()||"",s("region from cache:",this.region||"(none)"),(this.skipRouteCheck?Promise.resolve(null):this.fetchConfig()).then(t=>{let i;if(t)i=this.chooseEndpoint(t);else if(this.fallbackPollingUrl)c("no app config \u2014 falling back to polling",this.fallbackPollingUrl),i={type:"polling",url:this.fallbackPollingUrl,environmentId:""},this.requireEnvironmentId=!1;else{this.fail("no-config");return}if(!i){this.fail("no-endpoint");return}if(s("endpoint chosen",{type:i.type,url:i.url,environmentId:i.environmentId}),this.requireEnvironmentId&&!i.environmentId){this.fail("no-environment-id");return}this.orchestrationType=i.type,this.environmentId=i.environmentId||void 0;const n=this.adaptUrlToRegion(i.url);return(i.type==="polling"?this.pollOrchestration(n):Promise.resolve(n)).then(a=>{if(!a){this.fail("no-ws-url");return}return this.parked.machineId=a,s("opening socket",a),this.openSocket(a)})})}fetchConfig(){const e=new URL(this.configUrl,window.location.origin).href;return this.fetchWithTimeout(e,{credentials:"omit"},this.config.poll_timeout).then(t=>t.ok?t.json().catch(()=>null):null).catch(()=>null)}chooseEndpoint(e){const t=e.newSignalling,i=this.firstVersionUrl(t&&t.versions);if(i&&/^wss?:\/\//i.test(i))return{type:"direct",url:i,environmentId:t&&t.environmentId||""};const n=e.signalling,r=this.firstVersionUrl(n&&n.versions);return r?{type:"polling",url:r,environmentId:n&&n.environmentId||""}:null}firstVersionUrl(e){if(!e||typeof e!="object")return"";for(const t of Object.keys(e))if(e[t])return e[t];return""}pollOrchestration(e){const t=`${e}${this.ids.clientId}/${this.ids.viewId}`;return this.fetchWithTimeout(t,{credentials:"omit"},this.config.poll_timeout).then(i=>i.ok?i.json().catch(()=>({})):null).then(i=>i&&i.signallingServer?I(`${window.location.protocol}//${i.signallingServer}`):null).catch(()=>null)}adaptUrlToRegion(e){return this.region&&e.indexOf(":region")===-1?e.replace(/signallingserver/gi,`signallingserver/region:${this.region}`):e}openSocket(e){const t=new WebSocket(e);t.binaryType="arraybuffer",this.ws=t,this.parked.ws=t,this.wsTimeoutId=setTimeout(()=>{t.readyState!==WebSocket.OPEN&&this.fail("ws-timeout")},this.config.ws_timeout),t.onopen=()=>{clearTimeout(this.wsTimeoutId),this.mark("ws_open"),s("WS open \u2192 sending requestStream",{environmentId:this.environmentId,region:this.region,context:this.context}),this.sendRequestStream()},t.onmessage=i=>this.onWsMessage(i),t.onerror=i=>{u("WS error",i),this.fail("ws-error")},t.onclose=i=>{!this.settled&&this.parked.state!=="ready"&&(c("WS closed before ready",{code:i&&i.code}),this.fail("ws-closed"))},this.armWatchdog()}sendRequestStream(){this.send({type:"requestStream",correlationId:this.ids.correlationId,payload:{region:this.region,environmentId:this.environmentId,context:this.context}})}onWsMessage(e){let t;try{const i=typeof e.data=="string"?e.data:null;if(i===null)return;t=JSON.parse(i)}catch{return}switch(s("WS \u2190",t.type),t.type){case"ssInfo":this.parked.ssData=t.data;break;case"config":this.onConfig(t);break;case"offer":this.onOffer(t);break;case"answer":this.onAnswer(t);break;case"iceCandidate":this.onIceCandidate(t.candidate);break;case"ping":this.send({type:"pong",source:"front"});break;case"streamerDisconnected":case"playerDisconnected":this.fail("streamer-disconnected");break;case"error":this.fail("orchestration-error");break;default:break}}onConfig(e){if(this.pc)return;const t=Object.assign({},e.peerConnectionOptions);this.forceTURN&&(t.iceTransportPolicy="relay"),t.bundlePolicy=this.forceMaxBundle?"max-bundle":"balanced",t.iceCandidatePoolSize=1,this.parked.config=t;const i=new RTCPeerConnection(t);this.pc=i,this.parked.pc=i,s("PeerConnection created from config"),i.onicecandidate=n=>{n.candidate&&this.send({type:"iceCandidate",candidate:n.candidate})},i.ondatachannel=n=>this.wireDataChannel(n.channel),i.ontrack=n=>{n.track&&n.track.kind==="video"&&n.streams[0]&&(s("video track received"),this.stream=n.streams[0],this.parked.stream=this.stream,this.maybeReady())}}onOffer(e){return this.pc?(this.remoteDescriptionSet=!1,this.iceBuffer.length=0,this.pc.setRemoteDescription(e).then(()=>(this.remoteDescriptionSet=!0,this.flushIce(),this.pc.createAnswer())).then(t=>(t.sdp=this.mungeSDP(t.sdp||""),this.pc.setLocalDescription(t).then(()=>{s("WS \u2192 answer sent"),this.send(t)}))).catch(t=>this.fail("offer-failed",t))):Promise.resolve()}onAnswer(e){return this.pc?this.pc.setRemoteDescription(e).then(()=>{this.remoteDescriptionSet=!0,this.flushIce()}).catch(t=>this.fail("answer-failed",t)):Promise.resolve()}onIceCandidate(e){e&&(this.forceTURN&&String(e.candidate).indexOf("relay")<0||(this.remoteDescriptionSet&&this.pc?this.pc.addIceCandidate(e).catch(()=>{}):this.iceBuffer.push(e)))}flushIce(){for(const e of this.iceBuffer)this.pc.addIceCandidate(e).catch(()=>{});this.iceBuffer.length=0}wireDataChannel(e){e.binaryType="arraybuffer",this.dc=e,this.parked.dc=e,e.onmessage=t=>{this.parked.dcBuffer.push(t.data)},e.onopen=()=>{s("DataChannel open"),this.mark("dc_open"),this.maybeReady()},e.onclose=()=>{!this.settled&&this.parked.state!=="ready"&&(c("DataChannel closed before ready"),this.fail("dc-closed"))},e.readyState==="open"&&this.maybeReady()}maybeReady(){this.settled||!this.dc||this.dc.readyState!=="open"||this.stream&&(this.settled=!0,this.mark("ready"),this.parked.state="ready",s("READY \u2014 parked on window.__stream",this.parked.timings))}publishParked(e){const t=this;this.parked={state:e,pc:null,dc:null,stream:null,ws:null,ssData:void 0,machineId:void 0,config:void 0,ids:this.ids,dcBuffer:[],timings:{},adopt(){return t.clearWatchdog(),this.state="adopted",this}},window.__stream=this.parked}armWatchdog(){this.clearWatchdog(),this.watchdogId=setTimeout(()=>{this.parked.state!=="adopted"&&(c(`not adopted within ${this.config.watchdog_ms}ms \u2014 tearing down`,{state:this.parked.state}),this.fail("watchdog"))},this.config.watchdog_ms)}clearWatchdog(){this.watchdogId&&(clearTimeout(this.watchdogId),this.watchdogId=null),this.wsTimeoutId&&(clearTimeout(this.wsTimeoutId),this.wsTimeoutId=null)}fail(e,t){if(!(this.parked&&(this.parked.state==="adopted"||this.parked.state==="failed"))){u("FAILED:",e,t||""),this.settled=!0,this.clearWatchdog();try{this.dc&&this.dc.close()}catch{}try{this.pc&&this.pc.close()}catch{}try{this.ws&&this.ws.close()}catch{}this.parked&&(this.parked.state="failed",this.parked.failReason=e,t&&(this.parked.failError=String(t&&t.message||t)))}}mungeSDP(e){let t=this.prioritizeH264Profile(e,k);t=t.replace(/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm,`$1;x-google-start-bitrate=10000;x-google-max-bitrate=100000\r
|
|
2
|
+
`);let i="maxaveragebitrate=510000;";return i+=this.forceMonoAudio?"stereo=0;":"stereo=1;",i+="useinbandfec=1",t=t.replace("useinbandfec=1",i),t}prioritizeH264Profile(e,t){const i=e.split(`\r
|
|
3
|
+
`),n=[];for(const r of i)if(r.startsWith("a=fmtp:")&&r.toLowerCase().includes(`profile-level-id=${t}`)){const a=r.split(":")[1]&&r.split(":")[1].split(" ")[0];a&&n.push(a)}return n.length===0?e:i.map(r=>{if(!r.startsWith("m=video"))return r;const a=r.split(" "),x=a.slice(0,3),p=a.slice(3),b=[...n.filter(d=>p.includes(d)),...p.filter(d=>!n.includes(d))];return[...x,...b].join(" ")}).join(`\r
|
|
4
|
+
`)}send(e){const t=typeof e=="string"?e:JSON.stringify(e);if(this.ws&&this.ws.readyState===WebSocket.OPEN)try{this.ws.send(t)}catch{}}mark(e){this.parked&&(this.parked.timings[e]=performance.now())}readRegion(){try{const e=localStorage.getItem(g);if(!e)return null;const t=JSON.parse(e);return!t||typeof t.region_code!="string"||typeof t.ts!="number"||Date.now()-t.ts>=2592e6?null:t.region_code}catch{return null}}fetchWithTimeout(e,t,i){const n=new AbortController;t.signal=n.signal;const r=setTimeout(()=>n.abort(),i);return fetch(e,t).finally(()=>clearTimeout(r))}numberOr(e,t){const i=Number(e);return e!=null&&e!==""&&!Number.isNaN(i)?i:t}boolOr(e,t){return e==="true"||e===""?!0:e==="false"?!1:t}}new y().run()})();
|
package/package.json
CHANGED
|
@@ -231,18 +231,6 @@ interface FreezeFrameMessage {
|
|
|
231
231
|
progress: number | null;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
interface ReconnectConfig {
|
|
235
|
-
/** Enable auto-reconnection when WebRTC or DataChannel connection is lost. Default: true */
|
|
236
|
-
enabled?: boolean;
|
|
237
|
-
/** Maximum number of reconnection attempts before giving up. Default: 3 */
|
|
238
|
-
maxAttempts?: number;
|
|
239
|
-
/** Delay in milliseconds between reconnection attempts. Default: 1000 */
|
|
240
|
-
delayMs?: number;
|
|
241
|
-
/** Reconnect on ICE connection failure (disconnected/failed state). Default: true */
|
|
242
|
-
onIceFailure?: boolean;
|
|
243
|
-
/** Reconnect on DataChannel close. Default: true */
|
|
244
|
-
onDataChannelClose?: boolean;
|
|
245
|
-
}
|
|
246
234
|
interface UnrealInitialConfig {
|
|
247
235
|
playwright?: boolean;
|
|
248
236
|
customErrorsEndpoint?: string;
|
|
@@ -253,8 +241,57 @@ interface UnrealInitialConfig {
|
|
|
253
241
|
streamTelemetryV2Url?: string;
|
|
254
242
|
fpsMonitor?: boolean;
|
|
255
243
|
autoHighResolution?: boolean;
|
|
256
|
-
|
|
257
|
-
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface SignalingData {
|
|
247
|
+
instanceType: string;
|
|
248
|
+
branchInfo: string;
|
|
249
|
+
cirrusVersion: string;
|
|
250
|
+
streamerVersion: string;
|
|
251
|
+
streamPath: string;
|
|
252
|
+
streamApp: string;
|
|
253
|
+
connectionId: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Live WebRTC connection parked on `window.__stream` by the `stream-prefetch.js`
|
|
258
|
+
* head-script, ready for the Angular services to ADOPT instead of building a
|
|
259
|
+
* connection from scratch. The shape is the handoff contract between that
|
|
260
|
+
* framework-free script and {@link StreamAdoptionService} — keep the two in sync.
|
|
261
|
+
*/
|
|
262
|
+
interface ParkedStream {
|
|
263
|
+
state: 'connecting' | 'ready' | 'failed' | 'adopted';
|
|
264
|
+
pc?: RTCPeerConnection;
|
|
265
|
+
dc?: RTCDataChannel;
|
|
266
|
+
/** video(+audio) MediaStream from the `track` event */
|
|
267
|
+
stream?: MediaStream;
|
|
268
|
+
/** live signalling socket (handshake already done, `requestStream` sent) */
|
|
269
|
+
ws?: WebSocket;
|
|
270
|
+
/** `data` from the streamer's `ssInfo` message — received before adoption */
|
|
271
|
+
ssData?: SignalingData;
|
|
272
|
+
/** = resolved wsUrl of the winning machine */
|
|
273
|
+
machineId?: string;
|
|
274
|
+
/** `peerConnectionOptions` the machine sent in its `config` message */
|
|
275
|
+
config?: RTCConfiguration;
|
|
276
|
+
/** ids the script generated; Angular reuses them (no regeneration) */
|
|
277
|
+
ids: {
|
|
278
|
+
clientId: string;
|
|
279
|
+
viewId: string;
|
|
280
|
+
correlationId: string;
|
|
281
|
+
};
|
|
282
|
+
/** DataChannel messages received before adoption, replayed on adopt */
|
|
283
|
+
dcBuffer: ArrayBuffer[];
|
|
284
|
+
/** `performance.now()` marks for the prefetch waterfall (telemetry) */
|
|
285
|
+
timings: Record<string, number>;
|
|
286
|
+
failReason?: string;
|
|
287
|
+
failError?: string;
|
|
288
|
+
/** Stops the script's watchdog and flips state to `adopted`. */
|
|
289
|
+
adopt: () => ParkedStream;
|
|
290
|
+
}
|
|
291
|
+
declare global {
|
|
292
|
+
interface Window {
|
|
293
|
+
__stream?: ParkedStream;
|
|
294
|
+
}
|
|
258
295
|
}
|
|
259
296
|
|
|
260
297
|
declare const SpecialKeyCodes: {
|
|
@@ -367,11 +404,11 @@ declare const REGION_PING_CACHE_TTL_MS: number;
|
|
|
367
404
|
declare const REGION_PING_ACCURATE_SAMPLES = 3;
|
|
368
405
|
declare const REGION_PING_WARMUP_DEADLINE_MS = 1500;
|
|
369
406
|
declare const REGION_PING_BACKGROUND_REFRESH_DELAY_MS = 5000;
|
|
370
|
-
declare const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
407
|
+
declare const RECONNECT_CONFIG: {
|
|
408
|
+
readonly enabled: true;
|
|
409
|
+
readonly maxAttempts: 3;
|
|
410
|
+
readonly delayMs: 1000;
|
|
411
|
+
};
|
|
375
412
|
declare const UnrealStatusMessage: {
|
|
376
413
|
readonly CONNECTING_TO_SESSION: "Connecting to session.";
|
|
377
414
|
readonly STARTING_YOUR_SESSION: "Starting your session";
|
|
@@ -397,16 +434,6 @@ interface InputProps {
|
|
|
397
434
|
|
|
398
435
|
type Quality = 'lime' | 'red' | 'orange';
|
|
399
436
|
|
|
400
|
-
interface SignalingData {
|
|
401
|
-
instanceType: string;
|
|
402
|
-
branchInfo: string;
|
|
403
|
-
cirrusVersion: string;
|
|
404
|
-
streamerVersion: string;
|
|
405
|
-
streamPath: string;
|
|
406
|
-
streamApp: string;
|
|
407
|
-
connectionId: string;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
437
|
declare const OrchestrationMessageTypes: {
|
|
411
438
|
readonly ping: "ping";
|
|
412
439
|
readonly error: "error";
|
|
@@ -1019,6 +1046,15 @@ declare class SignallingService extends SubService {
|
|
|
1019
1046
|
private pollLoop;
|
|
1020
1047
|
private connectToCirrus;
|
|
1021
1048
|
private addWsHandlers;
|
|
1049
|
+
/**
|
|
1050
|
+
* Adopt a live signalling socket opened by the `stream-prefetch.js`
|
|
1051
|
+
* head-script. The socket is already OPEN and `requestStream` was already
|
|
1052
|
+
* sent, so — unlike {@link addWsHandlers} — we attach message/close/error
|
|
1053
|
+
* handlers but deliberately skip {@link OnOpenHandler} (which would
|
|
1054
|
+
* `setCirrusConnected` + re-`sendRequestStream`). Reuses the head-script's
|
|
1055
|
+
* `correlationId` so subsequent correlated messages line up.
|
|
1056
|
+
*/
|
|
1057
|
+
adoptSocket(ws: WebSocket, correlationId: string): void;
|
|
1022
1058
|
private showStatusMessage;
|
|
1023
1059
|
/**
|
|
1024
1060
|
* Close the connection with the signaling server
|
|
@@ -1038,6 +1074,39 @@ declare class SignallingService extends SubService {
|
|
|
1038
1074
|
static ɵprov: i0.ɵɵInjectableDeclaration<SignallingService>;
|
|
1039
1075
|
}
|
|
1040
1076
|
|
|
1077
|
+
/**
|
|
1078
|
+
* Adopts a WebRTC connection prefetched by the `stream-prefetch.js` head-script
|
|
1079
|
+
* and parked on `window.__stream`, instead of running `connectToSignaling` from
|
|
1080
|
+
* scratch. Called from the same seam where signalling normally starts
|
|
1081
|
+
* (`connectToSignaling$` effect); if there is nothing ready to adopt it returns
|
|
1082
|
+
* `false` and the caller falls back to the normal connect — strictly additive.
|
|
1083
|
+
*/
|
|
1084
|
+
declare class StreamAdoptionService {
|
|
1085
|
+
private readonly store;
|
|
1086
|
+
private readonly signalling;
|
|
1087
|
+
private readonly webRtc;
|
|
1088
|
+
/**
|
|
1089
|
+
* Decide adoption, WAITING for an in-flight prefetch instead of racing it.
|
|
1090
|
+
*
|
|
1091
|
+
* - nothing parked → emit `false` at once (caller connects normally).
|
|
1092
|
+
* - already settled (`ready`/`failed`/`adopted`) → adopt-if-ready at once.
|
|
1093
|
+
* - still `connecting` → poll until it settles, then adopt-if-ready. Bounded
|
|
1094
|
+
* by `timeoutMs` so a stuck prefetch can't block the fallback forever.
|
|
1095
|
+
*
|
|
1096
|
+
* Emits exactly once. Cancel by unsubscribing (the effect does this on
|
|
1097
|
+
* teardown via `takeUntil`) — no adoption runs after cancellation, which is
|
|
1098
|
+
* what stops a fast route-switch from starting overlapping connections.
|
|
1099
|
+
*/
|
|
1100
|
+
awaitAndAdopt$(timeoutMs: number): Observable<boolean>;
|
|
1101
|
+
/**
|
|
1102
|
+
* @returns `true` if a ready parked stream was adopted (caller must NOT
|
|
1103
|
+
* start a fresh connection), `false` otherwise.
|
|
1104
|
+
*/
|
|
1105
|
+
tryAdopt(): boolean;
|
|
1106
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StreamAdoptionService, never>;
|
|
1107
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StreamAdoptionService>;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1041
1110
|
declare class StreamStatusTelemetryService extends SubService {
|
|
1042
1111
|
private readonly videoService;
|
|
1043
1112
|
private readonly unrealConfig;
|
|
@@ -1416,6 +1485,16 @@ declare class WebRtcPlayerService extends SubService {
|
|
|
1416
1485
|
* @returns true if reconnection was initiated, false if signaling is not connected
|
|
1417
1486
|
*/
|
|
1418
1487
|
reconnectPeer(): boolean;
|
|
1488
|
+
/**
|
|
1489
|
+
* Adopt a fully-negotiated connection prefetched by `stream-prefetch.js`:
|
|
1490
|
+
* take ownership of its PeerConnection, DataChannel and media stream instead
|
|
1491
|
+
* of running the handshake. The head-script attached property-based handlers
|
|
1492
|
+
* (`pc.onicecandidate`, `dc.onmessage`, …) and buffered inbound DC messages;
|
|
1493
|
+
* here we detach those, wire our own (addEventListener-based) handlers, replay
|
|
1494
|
+
* the buffer in order, then drive `onDataChannelConnected` manually because the
|
|
1495
|
+
* DataChannel is already open (its `open` event won't fire again).
|
|
1496
|
+
*/
|
|
1497
|
+
adopt(pc: RTCPeerConnection, dc: RTCDataChannel, stream: MediaStream, config: RTCConfiguration, dcBuffer: ArrayBuffer[]): void;
|
|
1419
1498
|
private setConfig;
|
|
1420
1499
|
private handlePeerConnectionEvents;
|
|
1421
1500
|
private setupTransceiversAsync;
|
|
@@ -2476,6 +2555,24 @@ declare const showUnrealErrorMessage: node_modules__ngrx_store_types_ngrx_store.
|
|
|
2476
2555
|
error?: string;
|
|
2477
2556
|
} & node_modules__ngrx_store_types_ngrx_store.Action<string>>;
|
|
2478
2557
|
declare const initSignalling: node_modules__ngrx_store_types_ngrx_store.ActionCreator<string, () => node_modules__ngrx_store_types_ngrx_store.Action<string>>;
|
|
2558
|
+
/**
|
|
2559
|
+
* Dispatched when a prefetched connection parked on `window.__stream` by the
|
|
2560
|
+
* `stream-prefetch.js` head-script is adopted instead of opening a fresh
|
|
2561
|
+
* `connectToSignaling`. Marks cirrus connected and records the adopted machine
|
|
2562
|
+
* in one transaction; the data channel / app-init chain then proceeds via
|
|
2563
|
+
* `dataChannelConnected` dispatched from `WebRtcPlayerService`.
|
|
2564
|
+
*
|
|
2565
|
+
* Deliberately does NOT touch `streamClientCompanyId` / `streamViewId`: the host
|
|
2566
|
+
* app (e.g. metabox) sets those authoritatively from its own data before
|
|
2567
|
+
* `initSignalling`, and the prefetch script's ids are connection-internal only.
|
|
2568
|
+
*/
|
|
2569
|
+
declare const streamAdopted: node_modules__ngrx_store_types_ngrx_store.ActionCreator<string, (props: {
|
|
2570
|
+
machineId: string | null;
|
|
2571
|
+
ssData: SignalingData | null;
|
|
2572
|
+
}) => {
|
|
2573
|
+
machineId: string | null;
|
|
2574
|
+
ssData: SignalingData | null;
|
|
2575
|
+
} & node_modules__ngrx_store_types_ngrx_store.Action<string>>;
|
|
2479
2576
|
declare const startStream: node_modules__ngrx_store_types_ngrx_store.ActionCreator<string, (props: {
|
|
2480
2577
|
config: Partial<StreamConfig>;
|
|
2481
2578
|
}) => {
|
|
@@ -2572,11 +2669,11 @@ declare class UnrealEffects {
|
|
|
2572
2669
|
private readonly commandTelemetryService;
|
|
2573
2670
|
private readonly regionsPingService;
|
|
2574
2671
|
private readonly signallingService;
|
|
2672
|
+
private readonly streamAdoptionService;
|
|
2575
2673
|
private readonly videoService;
|
|
2576
2674
|
private readonly unrealCallbackService;
|
|
2577
2675
|
private dataChannelConnectionTimeout;
|
|
2578
2676
|
private connectionCompleted$;
|
|
2579
|
-
private reconnectConfig;
|
|
2580
2677
|
destroyConnections$: node_modules_rxjs_dist_types.Observable<{
|
|
2581
2678
|
reason: _3dsource_angular_unreal_module.DisconnectReasonType;
|
|
2582
2679
|
} & node_modules__ngrx_store_types_ngrx_store.Action<string>> & node_modules__ngrx_effects_types_ngrx_effects.CreateEffectMetadata;
|
|
@@ -2644,8 +2741,8 @@ declare class UnrealEffects {
|
|
|
2644
2741
|
* Effect: `handleDataChannelClosed$`
|
|
2645
2742
|
*
|
|
2646
2743
|
* Triggers peer reconnection when DataChannel closes unexpectedly.
|
|
2647
|
-
* Only triggers if reconnection is enabled
|
|
2648
|
-
*
|
|
2744
|
+
* Only triggers if reconnection is enabled and the signaling WebSocket
|
|
2745
|
+
* is still connected.
|
|
2649
2746
|
*/
|
|
2650
2747
|
handleDataChannelClosed$: node_modules_rxjs_dist_types.Observable<{
|
|
2651
2748
|
attempt: number;
|
|
@@ -2690,7 +2787,9 @@ declare class UnrealEffects {
|
|
|
2690
2787
|
id: string;
|
|
2691
2788
|
now: number;
|
|
2692
2789
|
} & node_modules__ngrx_store_types_ngrx_store.Action<string>> & node_modules__ngrx_effects_types_ngrx_effects.CreateEffectMetadata;
|
|
2693
|
-
connectToSignaling$: node_modules_rxjs_dist_types.Observable<
|
|
2790
|
+
connectToSignaling$: node_modules_rxjs_dist_types.Observable<{
|
|
2791
|
+
value: boolean;
|
|
2792
|
+
} & node_modules__ngrx_store_types_ngrx_store.Action<string>> & node_modules__ngrx_effects_types_ngrx_effects.CreateEffectMetadata;
|
|
2694
2793
|
private canPeerReconnect;
|
|
2695
2794
|
/**
|
|
2696
2795
|
* Either schedules the next peer-reconnect attempt or gives up with the
|
|
@@ -2848,5 +2947,5 @@ declare const selectUserInactivityDetected: node_modules__ngrx_store_types_ngrx_
|
|
|
2848
2947
|
/** Used by external consumers (e.g., metabox). Do not remove. */
|
|
2849
2948
|
declare const selectIsVideoPlayingAndDataChannelConnected: node_modules__ngrx_store_types_ngrx_store.MemoizedSelector<Record<string, any>, boolean, (s1: boolean, s2: boolean) => boolean>;
|
|
2850
2949
|
|
|
2851
|
-
export { AFKService, AUTO_HIGH_RESOLUTION_IDLE_MS, AfkTimeoutModalComponent, AggregatorService, AnalyticsService, AnswerHandler, CONSOLE_COMMAND_DISABLE_MESSAGES, CONSOLE_COMMAND_ENABLE_MESSAGES, CONSOLE_COMMAND_PIXEL_QUALITY, CommandTelemetryService, ConfigHandler, ConsoleExtensionsService, ControlScheme, DATA_CHANNEL_CONNECTION_TIMEOUT, DEBOUNCE_TO_MANY_RESIZE_CALLS, DEFAULT_AFK_TIMEOUT, DEFAULT_AFK_TIMEOUT_PERIOD,
|
|
2852
|
-
export type { AggregatedStat, AnySignalingMessage, AwsInstance, CandidateMessage, CloseReason, CommandInProgress, ConfigMessage, ConnectionError, ControlSchemeValues, DataFlowCheckResult, DisconnectReasonType, EmittedMilestone, EventId, ForceClientDisconnect, FreezeFrameMessage, InboundVideoStats, InputProps, InstanceReady, InstanceReserved, InterruptClientStream, ListStreamersMessage, MessageBase, MessageTypeValues, NormalizeAndQuantizeSignedValue, NormalizeAndQuantizeUnsignedValue, OrchestrationErrorMessage, OrchestrationMessageType, P2PEstablishedMessage, PhaseOverlay, PhaseParam, PingMessage, PlayerCountMessage, PollingOrchestrationMessage, Quality, ReceivedFile,
|
|
2950
|
+
export { AFKService, AUTO_HIGH_RESOLUTION_IDLE_MS, AfkTimeoutModalComponent, AggregatorService, AnalyticsService, AnswerHandler, CONSOLE_COMMAND_DISABLE_MESSAGES, CONSOLE_COMMAND_ENABLE_MESSAGES, CONSOLE_COMMAND_PIXEL_QUALITY, CommandTelemetryService, ConfigHandler, ConsoleExtensionsService, ControlScheme, DATA_CHANNEL_CONNECTION_TIMEOUT, DEBOUNCE_TO_MANY_RESIZE_CALLS, DEFAULT_AFK_TIMEOUT, DEFAULT_AFK_TIMEOUT_PERIOD, DESTROY_DISCONNECT_REASONS, DataFlowMonitor, DevModeService, DisconnectReason, FULL_HD_HEIGHT, FULL_HD_WIDTH, FileHandlerService, FileReceiverService, FilterSettingsComponent, FpsMonitorService, FreezeFrameComponent, FreezeFrameService, INNER_RETRY_LIMIT, IceCandidateHandler, ImageLoadingSrcComponent, InputOptions, InputService, InstanceReadyHandler, InstanceReservedHandler, IntroSrcComponent, KalmanFilter1D, LatencyTimings, LoadingProgressService, LowBandwidthDetectorComponent, LowBandwidthModalComponent, MINIMAL_FPS, MIN_CONTAINER_SIZE, MessageType, MouseButton, MouseButtonsMask, OUTER_RETRY_DELAY, OnCloseHandler, OnErrorHandler, OnMessageHandler, OnOpenHandler, OrchestrationMessageTypes, POLLING_TIME, PingHandler, PlayerCountHandler, RECONNECT_CONFIG, REGION_PING_ACCURATE_SAMPLES, REGION_PING_BACKGROUND_REFRESH_DELAY_MS, REGION_PING_CACHE_KEY, REGION_PING_CACHE_TTL_MS, REGION_PING_WARMUP_DEADLINE_MS, RegionsPingService, SAME_SIZE_THRESHOLD, SCREEN_LOCKER_CONTAINER_ID, SIGNALLING_PERCENT_VALUE, SSInfoHandler, STREAMING_AUDIO_ID, STREAMING_VIDEO_ID, SafePipe, SignallingService, SpecialKeyCodes, StatGraphComponent, StreamAdoptionService, StreamStatusTelemetryService, StreamStatusTelemetryService2, SubService, ToClientMessage, UNREAL_CONFIG, UnrealCallbackService, UnrealCommunicatorService, UnrealEffects, UnrealSceneComponent, UnrealStatusMessage, VideoService, VideoStatsComponent, WSCloseCode_CIRRUS_ABNORMAL_CLOSURE, WSCloseCode_CIRRUS_MAX_PLAYERS_ERROR, WSCloseCode_CIRRUS_PLAYER_DISCONNECTED, WSCloseCode_CIRRUS_STREAMER_KIKED_PLAYER, WSCloseCode_FORCE_CIRRUS_CLOSE, WSCloseCode_NORMAL_AFK_TIMEOUT, WSCloseCode_NORMAL_CLOSURE, WSCloseCode_NORMAL_MANUAL_DISCONNECT, WSCloseCode_UNKNOWN, WSCloseCodes, WS_OPEN_STATE, WS_RETRY_PER_INSTANCE, WS_TIMEOUT, WebRtcPlayerService, WebrtcErrorModalComponent, abortEstablishingConnection, answerSent, changeStatusMainVideoOnScene, changeStreamResolutionAction, commandCompleted, commandStarted, dataChannelConnected, dataChannelReady, decodeData, destroyRemoteConnections, destroyUnrealScene, disconnectStream, dispatchResize, dropConnection, dropDC, dropPC, floatToPercents, floatToSmoothPercents, forceResizeViewport, fromResizeObserver, getActiveUrl, getImageFromVideoStream, getResizeStudioValues, getResizeValuesUniversal, getRtcErrorMessage, iceConnectionFailed, initSignalling, instanceReady, keepMaxUntilReset, makeEven, pollingEnded, pollingStarted, provideUnrealModule, provideUnrealState, qpToQuality, reconnectPeer, reconnectPeerFailed, reconnectPeerSuccess, regionPingFetchEnd, regionPingFetchStart, regionResolved, resetAfk, resetConfig, resetDataChannelForReconnect, resetIntroSrc, resetUserInactivityTimeout, resetWarnTimeout, saveAnalyticsEvent, selectCirrusConnectionId, selectClientAndViewIds, selectCommandProgress, selectFreezeFrameCombinedDataUrl, selectFreezeFrameDataUrl, selectFreezeFrameDataUrlFromVideo, selectFreezeFrameProgressMessageFromVideo, selectIsAutostart, selectIsExistMatchUrls, selectIsFreezeFrameLoading, selectIsFullyConnected, selectIsLoaderScreenVisible, selectIsVideoPlayingAndDataChannelConnected, selectShowLoader, selectShowReconnectPopup, selectSignalingParameters, selectStreamConfig, selectTotalProgress, selectUserInactivityDetected, selectWarnTimeout, setAfkTimerCountdown, setAfkTimerHide, setAfkTimerVisible, setAwsInstance, setCirrusConnected, setCirrusDisconnected, setConfig, setEstablishingConnection, setFreezeFrame, setFreezeFrameFromVideo, setIntroImageSrc, setIntroVideoSrc, setLoadingImageSrc, setLoopBackCommandIsCompleted, setMaxFps, setOrchestrationContext, setOrchestrationMessage, setOrchestrationParameters, setOrchestrationProgress, setSignalingName, setStatusMessage, setStatusPercentSignallingServer, setStreamClientCompanyId, setStreamViewId, setUnrealPlaywrightConfig, setUserInactivityTimeout, setViewportNotReady, setViewportReady, showLoadingProgress, showResumeStreamPopup, showUnrealErrorMessage, showUserInactivityTimeoutPopup, signalingRetryAttempted, smoothTransition, startStream, streamAdopted, trackMixpanelEvent, trackTelemetryData, uint8ToBase64, unrealCommandCallback, unrealFeature, unrealReducer, updateCirrusInfo, videoAdaptedToContainer, videoStreamInitialized };
|
|
2951
|
+
export type { AggregatedStat, AnySignalingMessage, AwsInstance, CandidateMessage, CloseReason, CommandInProgress, ConfigMessage, ConnectionError, ControlSchemeValues, DataFlowCheckResult, DisconnectReasonType, EmittedMilestone, EventId, ForceClientDisconnect, FreezeFrameMessage, InboundVideoStats, InputProps, InstanceReady, InstanceReserved, InterruptClientStream, ListStreamersMessage, MessageBase, MessageTypeValues, NormalizeAndQuantizeSignedValue, NormalizeAndQuantizeUnsignedValue, OrchestrationErrorMessage, OrchestrationMessageType, P2PEstablishedMessage, ParkedStream, PhaseOverlay, PhaseParam, PingMessage, PlayerCountMessage, PollingOrchestrationMessage, Quality, ReceivedFile, RequestStream, SSInfo, SelectedIceCandidatePair, SignalingData, SignalingMessageHandler, SignalingMessageMap, StreamConfig, StreamRequestContext, StreamResolutionProps, StreamerListMessage, TelemetryType, UnknownFields, UnquantizeAndDenormalizeUnsignedValue, UnrealCallbackDescriptor, UnrealCallbackEventMap, UnrealCallbackJson, UnrealCallbackJsonWrapped, UnrealInitialConfig, UnrealState, WSCloseCodesValues, streamPreparedForUserInteractionMessage };
|