@fraku/video 0.1.55 → 0.1.57

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.
@@ -3,5 +3,5 @@ import { UserListControllerReturn } from './useUserListController';
3
3
  type UserListViewProps = UserListControllerReturn & {
4
4
  columnHeader: string;
5
5
  };
6
- declare const UserListView: ({ can, columnHeader, currentUserId, filteredUsers, filter, handleMakeHost, handleMakeManager, handleRevokeManager, handleRequestMakeHost, handleToggleParticipantMic, loading, setFilter, setSelectedUser, userMenuRef }: UserListViewProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const UserListView: ({ can, columnHeader, currentUserId, filteredUsers, filter, handleMakeHost, handleMakeManager, handleRevokeManager, handleRequestMakeHost, handleToggleParticipantMic, showUserMenuButton, loading, setFilter, setSelectedUser, userMenuRef }: UserListViewProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export default UserListView;
@@ -18,6 +18,7 @@ export type UserListControllerReturn = {
18
18
  handleRevokeManager: () => Promise<void>;
19
19
  handleRequestMakeHost: () => Promise<void>;
20
20
  handleToggleParticipantMic: (p: Participant) => Promise<void>;
21
+ showUserMenuButton: boolean;
21
22
  loading: boolean;
22
23
  setFilter: ReactSetter<string>;
23
24
  setSelectedUser: ReactSetter<Participant | null>;
@@ -0,0 +1,26 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { VideoPlayer } from '@zoom/videosdk';
3
+ import { VideoAttachmentMode } from '../../../providers/VideoAttachmentState';
4
+
5
+ type VideoAttachmentRefs = {
6
+ selfShareViewRef: MutableRefObject<HTMLVideoElement | null>;
7
+ otherSharedVideoPlayerRef: MutableRefObject<VideoPlayer | null>;
8
+ videoPlayerRef: MutableRefObject<VideoPlayer | null>;
9
+ selfViewVideoPlayerRef: MutableRefObject<VideoPlayer | null>;
10
+ };
11
+ /**
12
+ * useVideoAttachment coordinates video attach/detach operations.
13
+ *
14
+ * This hook implements the critical pattern:
15
+ * 1. Detach previous attachment (if any)
16
+ * 2. Attach new attachment (based on current mode)
17
+ *
18
+ * This ensures only ONE video is attached at any given time and prevents
19
+ * race conditions or SDK errors from overlapping attachments.
20
+ *
21
+ * @param mode - Current video attachment mode
22
+ * @param userId - User ID to attach (null for NONE mode)
23
+ * @param refs - Refs to all 4 video containers
24
+ */
25
+ export declare const useVideoAttachment: (mode: VideoAttachmentMode, userId: number | null, refs: VideoAttachmentRefs) => void;
26
+ export {};
@@ -0,0 +1,15 @@
1
+ import { VideoAttachmentStateProviderProps } from './types';
2
+
3
+ /**
4
+ * VideoAttachmentStateProvider determines which video container should have video attached.
5
+ *
6
+ * Responsibilities:
7
+ * - Centralizes logic for determining attachment mode
8
+ * - Enforces priority order: self-share > other-share > other-camera > self-camera > none
9
+ * - Provides mode and userId to components for attachment coordination
10
+ *
11
+ * This provider does NOT handle actual attach/detach operations.
12
+ * Those are handled by the useVideoAttachment hook in UserVideo component.
13
+ */
14
+ declare const VideoAttachmentStateProvider: ({ children }: VideoAttachmentStateProviderProps) => import("react/jsx-runtime").JSX.Element;
15
+ export default VideoAttachmentStateProvider;
@@ -0,0 +1,8 @@
1
+ import { VideoAttachmentMode } from './types';
2
+
3
+ export type VideoAttachmentStateContextType = {
4
+ mode: VideoAttachmentMode;
5
+ userId: number | null;
6
+ };
7
+ export declare const VideoAttachmentStateContext: import('react').Context<VideoAttachmentStateContextType | undefined>;
8
+ export declare const useVideoAttachmentState: () => VideoAttachmentStateContextType;
@@ -0,0 +1,4 @@
1
+ export { default as VideoAttachmentStateProvider } from './VideoAttachmentState';
2
+ export { useVideoAttachmentState } from './context';
3
+ export { VideoAttachmentMode } from './types';
4
+ export type { VideoAttachmentState, VideoAttachmentStateProviderProps } from './types';
@@ -0,0 +1,31 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ /**
4
+ * Video attachment modes representing which container should have video attached.
5
+ * Priority order (highest to lowest):
6
+ * 1. SELF_SHARE - Current user sharing screen
7
+ * 2. OTHER_SHARE - Another user sharing screen
8
+ * 3. OTHER_CAMERA - Other user's camera
9
+ * 4. SELF_CAMERA - Current user's camera
10
+ * 5. NONE - No video attached
11
+ */
12
+ export declare enum VideoAttachmentMode {
13
+ SELF_SHARE = "self-share",// Self screen sharing - uses selfShareViewRef
14
+ OTHER_SHARE = "other-share",// Other user sharing - uses otherSharedVideoPlayerRef
15
+ OTHER_CAMERA = "other-camera",// Other user camera - uses videoPlayerRef
16
+ SELF_CAMERA = "self-camera",// Self camera view - uses selfViewVideoPlayerRef
17
+ NONE = "none"
18
+ }
19
+ /**
20
+ * Current video attachment state
21
+ *
22
+ * @property mode - Current attachment mode (which container should have video)
23
+ * @property userId - User ID whose video should be attached (null when mode is NONE)
24
+ */
25
+ export type VideoAttachmentState = {
26
+ mode: VideoAttachmentMode;
27
+ userId: number | null;
28
+ };
29
+ export type VideoAttachmentStateProviderProps = {
30
+ children: ReactNode;
31
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fraku/video",
3
3
  "private": false,
4
- "version": "0.1.55",
4
+ "version": "0.1.57",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",