UNPKG

web3d

Version:

MetaEditor — ReactJS Pixel Streaming library, helps integrate Unreal Engine v.5 in the browser. Allows you to send commands and get callbacks from the stream server with launched Unreal Engine.

1 lines 952 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const defaultState={users_count:0,loaded:!1,connected:!1,active:!1,error:!1,closed:!1,callback_loading:!1,callback_caller:!1},initialState={...defaultState,stream_config:!1,mouse_moving:!1,aggregated_stats:!1,window_size:{width:0,height:0},quality_speed:!1,last_interaction:null,stream_stopped:!1,settings:{quality:1,inited:!1,volume:1,host:void 0,port:void 0,pixelStreaming:void 0},metaSettings:{showDevTools:!0,notifyCommands:!0,notifyCallbacks:!0}},KEY={UPDATE:"UPDATE",SETTINGS:"SETTINGS",META_SETTINGS:"META_SETTINGS"};function reducer(a,b){const{type:c,payload:d}=b;return(a.active=a.loaded&&a.connected,c===KEY.UPDATE)?{...a,...d}:(c===KEY.SETTINGS?a.settings={...a.settings,...d}:c===KEY.META_SETTINGS&&(a.metaSettings={...a.metaSettings,...d}),window.__ps_state__=a,{...a})}var _default={defaultState,initialState,KEY,reducer};exports.default=_default;