@naviedu/room-platform-react 0.0.44 → 0.0.46

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 CHANGED
@@ -79,16 +79,17 @@ layout that allows the room to occupy the viewport.
79
79
 
80
80
  ## `RoomPlatformRoom` props
81
81
 
82
- | Prop | Required | Description |
83
- | ------------------------ | -------- | ------------------------------------------------------------------------------------ |
84
- | `apiBaseUrl` | Yes | Room Platform API prefix. Do not append `/rooms`. |
85
- | `launchToken` | Yes | Initial server-issued launch ticket. |
86
- | `onLaunchTicketRequired` | Yes | Returns `{ launchToken }` when the current ticket or access session must be renewed. |
87
- | `extensions` | No | Host-provided top-bar, workspace, sidebar, monitor, and participant extensions. |
88
- | `onError` | No | Receives connection, media, and action errors. |
89
- | `onLifecycleEvent` | No | Receives exchange, renewal, and reconnect lifecycle events. |
90
- | `onExit` | No | Called when the user chooses to leave the room. |
91
- | `children` | No | Replaces the default workspace while keeping the provider and room runtime. |
82
+ | Prop | Required | Description |
83
+ | ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
84
+ | `apiBaseUrl` | Yes | Room Platform API prefix. Do not append `/rooms`. |
85
+ | `launchToken` | Yes | Initial server-issued launch ticket. |
86
+ | `onLaunchTicketRequired` | Yes | Returns `{ launchToken }` when the current ticket or access session must be renewed. |
87
+ | `extensions` | No | Host-provided top-bar, workspace, sidebar, monitor, and participant extensions. |
88
+ | `primaryCameraPlacement` | No | `overlay` (default) keeps the practice camera over the workspace; `sidebar` renders the local primary camera in the Room Platform sidebar. |
89
+ | `onError` | No | Receives connection, media, and action errors. |
90
+ | `onLifecycleEvent` | No | Receives exchange, renewal, and reconnect lifecycle events. |
91
+ | `onExit` | No | Called when the user chooses to leave the room. |
92
+ | `children` | No | Replaces the default workspace while keeping the provider and room runtime. |
92
93
 
93
94
  The default teaching stage selects the available participant camera carrying
94
95
  the canonical `room:moderate` capability. Screen share remains primary and the
@@ -99,6 +100,8 @@ its existing desktop breakpoint remains unchanged.
99
100
 
100
101
  The public room keeps one canonical local camera track. It may be preview-only
101
102
  before publication, and preview visibility never grants `media:publish_video`.
103
+ Camera placement does not change camera permissions, publication, or LiveKit
104
+ track lifecycle.
102
105
 
103
106
  ### Error and lifecycle callbacks
104
107
 
package/index.d.ts CHANGED
@@ -580,6 +580,7 @@ export declare type RoomPlatformRoomProps = {
580
580
  extensions?: RoomPlatformExtensions;
581
581
  launchToken: string;
582
582
  modeConfig?: RoomPlatformModeConfig;
583
+ primaryCameraPlacement?: 'overlay' | 'sidebar';
583
584
  shadowDom?: boolean;
584
585
  sizing?: RoomPlatformSizing;
585
586
  onError?: (event: RoomPlatformErrorEvent) => void;
package/index.esm.js CHANGED
@@ -29067,9 +29067,9 @@ function getTrackAspectRatio(trackRef) {
29067
29067
  }
29068
29068
  function RoomPlatformStage(param) {
29069
29069
  var controlBar = param.controlBar, _param_layout = param.layout, layout = _param_layout === void 0 ? 'stage' : _param_layout, model = param.model, overlayTrack = param.overlayTrack, status = param.status, whiteboard = param.whiteboard;
29070
- var _ref, _ref1;
29070
+ var _ref;
29071
29071
  var _model_primary, _model_primary1;
29072
- var cameraOverlayTrack = (_ref = overlayTrack !== null && overlayTrack !== void 0 ? overlayTrack : model.localPreview) !== null && _ref !== void 0 ? _ref : model.primary;
29072
+ var cameraOverlayTrack = overlayTrack !== null && overlayTrack !== void 0 ? overlayTrack : model.primary;
29073
29073
  var displayedTrack = layout === 'camera-overlay' ? cameraOverlayTrack : model.primary;
29074
29074
  var dimensions = displayedTrack === null || displayedTrack === void 0 ? void 0 : displayedTrack.publication.dimensions;
29075
29075
  var screenShareTrack = layout === 'stage' && ((_model_primary = model.primary) === null || _model_primary === void 0 ? void 0 : _model_primary.source) === Track.Source.ScreenShare ? model.primary : null;
@@ -29114,7 +29114,7 @@ function RoomPlatformStage(param) {
29114
29114
  style: frameStyle,
29115
29115
  children: /*#__PURE__*/ jsx("section", {
29116
29116
  className: frameClassName,
29117
- "data-source": (_ref1 = (_model_primary1 = model.primary) === null || _model_primary1 === void 0 ? void 0 : _model_primary1.source) !== null && _ref1 !== void 0 ? _ref1 : 'empty',
29117
+ "data-source": (_ref = (_model_primary1 = model.primary) === null || _model_primary1 === void 0 ? void 0 : _model_primary1.source) !== null && _ref !== void 0 ? _ref : 'empty',
29118
29118
  "data-testid": "room-platform-stage-frame",
29119
29119
  style: frameStyle,
29120
29120
  children: isScreenShare && model.primary ? /*#__PURE__*/ jsx("div", {
@@ -29576,7 +29576,7 @@ function RoomPlatformWhiteboardShareLifecycle(param) {
29576
29576
  return null;
29577
29577
  }
29578
29578
  var RoomPlatformWorkspaceContent = function(param) {
29579
- var cameraBackground = param.cameraBackground, completionAction = param.completionAction, extensions = param.extensions, modeConfig = param.modeConfig, onExit = param.onExit, sizing = param.sizing, stageModel = param.stageModel;
29579
+ var cameraBackground = param.cameraBackground, completionAction = param.completionAction, extensions = param.extensions, modeConfig = param.modeConfig, onExit = param.onExit, _param_primaryCameraPlacement = param.primaryCameraPlacement, primaryCameraPlacement = _param_primaryCameraPlacement === void 0 ? 'overlay' : _param_primaryCameraPlacement, sizing = param.sizing, stageModel = param.stageModel;
29580
29580
  var _resolvedStageModel_cameraOverlay, _ref, _ref1, _ref2, _ref3, _ref4;
29581
29581
  var _resolvedStageModel_primary, _resolvedStageModel_primary1, _extensions_sidebarTabs;
29582
29582
  var _useRoomPlatform = useRoomPlatform(), access = _useRoomPlatform.access, controlState = _useRoomPlatform.controlState, error = _useRoomPlatform.error, hasCapability = _useRoomPlatform.hasCapability, isActionPending = _useRoomPlatform.isActionPending, localCameraTrack = _useRoomPlatform.localCameraTrack, performAction = _useRoomPlatform.performAction, status = _useRoomPlatform.status;
@@ -29820,10 +29820,10 @@ var RoomPlatformWorkspaceContent = function(param) {
29820
29820
  var activeSpeakerSlot = resolvedStageModel.activeSpeaker && !isSelfActiveSpeaker ? /*#__PURE__*/ jsx(RoomPlatformActiveSpeaker, {
29821
29821
  trackRef: resolvedStageModel.activeSpeaker
29822
29822
  }) : undefined;
29823
- var localMediaSlot = (selectedHostCamera === null || selectedHostCamera === void 0 ? void 0 : selectedHostCamera.participant.isLocal) ? undefined : /*#__PURE__*/ jsx(RoomPlatformLocalPreview, {
29823
+ var localMediaSlot = primaryCameraPlacement === 'sidebar' || !(selectedHostCamera === null || selectedHostCamera === void 0 ? void 0 : selectedHostCamera.participant.isLocal) ? /*#__PURE__*/ jsx(RoomPlatformLocalPreview, {
29824
29824
  localTrack: localCameraTrack,
29825
29825
  trackRef: resolvedStageModel.localPreview
29826
- });
29826
+ }) : undefined;
29827
29827
  var activeSpeakerMediaSlot = hasActiveSpeaker && !canModerate ? activeSpeakerSlot : undefined;
29828
29828
  var isClearingActiveSpeaker = isActionPending(RoomPlatformAction.SPEAKER_CLEAR);
29829
29829
  var clearActiveSpeaker = function() {
@@ -29950,12 +29950,12 @@ var RoomPlatformWorkspaceContent = function(param) {
29950
29950
  className: "min-h-0 bg-slate-950",
29951
29951
  controlBar: controlBar,
29952
29952
  children: [
29953
- /*#__PURE__*/ jsx(RoomPlatformStage, {
29953
+ primaryCameraPlacement === 'overlay' ? /*#__PURE__*/ jsx(RoomPlatformStage, {
29954
29954
  layout: "camera-overlay",
29955
29955
  model: resolvedStageModel,
29956
29956
  overlayTrack: workspaceOverlayTrack,
29957
29957
  status: status
29958
- }),
29958
+ }) : null,
29959
29959
  /*#__PURE__*/ jsx(RoomPlatformExtensionZone, {
29960
29960
  component: MainWorkspace,
29961
29961
  extensionProps: extensionProps
@@ -30205,12 +30205,13 @@ function RoomPlatformPrivateRoomRuntime(param) {
30205
30205
  });
30206
30206
  }
30207
30207
  function RoomPlatformRuntime(_0) {
30208
- var children = _0.children, completionAction = _0.completionAction, extensions = _0.extensions, modeConfig = _0.modeConfig, onExit = _0.onExit, _0_sizing = _0.sizing, sizing = _0_sizing === void 0 ? 'viewport' : _0_sizing, providerProps = _object_without_properties(_0, [
30208
+ var children = _0.children, completionAction = _0.completionAction, extensions = _0.extensions, modeConfig = _0.modeConfig, onExit = _0.onExit, primaryCameraPlacement = _0.primaryCameraPlacement, _0_sizing = _0.sizing, sizing = _0_sizing === void 0 ? 'viewport' : _0_sizing, providerProps = _object_without_properties(_0, [
30209
30209
  "children",
30210
30210
  "completionAction",
30211
30211
  "extensions",
30212
30212
  "modeConfig",
30213
30213
  "onExit",
30214
+ "primaryCameraPlacement",
30214
30215
  "sizing"
30215
30216
  ]);
30216
30217
  return /*#__PURE__*/ jsx(RoomPlatformProvider, _object_spread_props(_object_spread({}, providerProps), {
@@ -30221,6 +30222,7 @@ function RoomPlatformRuntime(_0) {
30221
30222
  extensions: extensions,
30222
30223
  modeConfig: modeConfig,
30223
30224
  onExit: onExit,
30225
+ primaryCameraPlacement: primaryCameraPlacement,
30224
30226
  sizing: sizing
30225
30227
  })
30226
30228
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naviedu/room-platform-react",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "type": "module",
5
5
  "main": "./index.esm.js",
6
6
  "module": "./index.esm.js",