vg-x07df 0.1.0
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/.azure-pipelines/publish-public.yml +37 -0
- package/.azure-pipelines/publish.yml +39 -0
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/AUTO_JOIN_GUIDE.md +411 -0
- package/README.md +215 -0
- package/Screenshot 2025-09-24 at 14.34.48.png +0 -0
- package/Screenshot 2025-10-04 at 12.58.54.png +0 -0
- package/biome.json +48 -0
- package/examples/demo/.env.example +19 -0
- package/examples/demo/CHANGELOG.md +22 -0
- package/examples/demo/README.md +72 -0
- package/examples/demo/eslint.config.js +23 -0
- package/examples/demo/index.html +13 -0
- package/examples/demo/package.json +34 -0
- package/examples/demo/pnpm-lock.yaml +2098 -0
- package/examples/demo/pnpm-workspace.yaml +1 -0
- package/examples/demo/public/vite.svg +1 -0
- package/examples/demo/src/App.css +52 -0
- package/examples/demo/src/App.tsx +176 -0
- package/examples/demo/src/assets/react.svg +1 -0
- package/examples/demo/src/components/auth/LoginForm.css +144 -0
- package/examples/demo/src/components/auth/LoginForm.tsx +80 -0
- package/examples/demo/src/components/calling/AutoJoinSettings.tsx +213 -0
- package/examples/demo/src/components/calling/AutoJoinStatus.tsx +72 -0
- package/examples/demo/src/components/calling/CallInitiator.css +258 -0
- package/examples/demo/src/components/calling/CallInitiator.tsx +142 -0
- package/examples/demo/src/components/calling/CallNotifications.css +119 -0
- package/examples/demo/src/components/calling/CallNotifications.tsx +108 -0
- package/examples/demo/src/components/calling/IncomingCallModal.css +192 -0
- package/examples/demo/src/components/calling/IncomingCallModal.tsx +78 -0
- package/examples/demo/src/components/calling/MinimizedCall.css +156 -0
- package/examples/demo/src/components/calling/MinimizedCall.tsx +78 -0
- package/examples/demo/src/components/conference/ConferenceHeader.css +265 -0
- package/examples/demo/src/components/conference/ConferenceHeader.tsx +78 -0
- package/examples/demo/src/components/conference/EnhancedControlBar.css +356 -0
- package/examples/demo/src/components/conference/EnhancedControlBar.tsx +262 -0
- package/examples/demo/src/components/conference/PaginationControls.css +67 -0
- package/examples/demo/src/components/conference/PaginationControls.tsx +64 -0
- package/examples/demo/src/components/conference/ParticipantGrid.css +153 -0
- package/examples/demo/src/components/conference/ParticipantGrid.tsx +87 -0
- package/examples/demo/src/components/conference/ParticipantTile.css +210 -0
- package/examples/demo/src/components/conference/ParticipantTile.tsx +114 -0
- package/examples/demo/src/components/conference/VideoConference.css +214 -0
- package/examples/demo/src/components/conference/VideoConference.tsx +93 -0
- package/examples/demo/src/contexts/AuthContext.tsx +105 -0
- package/examples/demo/src/hooks/useAuth.ts +5 -0
- package/examples/demo/src/hooks/useCallTimer.ts +42 -0
- package/examples/demo/src/index.css +68 -0
- package/examples/demo/src/main.tsx +10 -0
- package/examples/demo/src/services/auth.service.ts +153 -0
- package/examples/demo/src/types/auth.types.ts +31 -0
- package/examples/demo/tsconfig.app.json +28 -0
- package/examples/demo/tsconfig.json +7 -0
- package/examples/demo/tsconfig.node.json +26 -0
- package/examples/demo/vite.config.ts +15 -0
- package/images/callpad-without-ai.png +0 -0
- package/package.json +28 -0
- package/packages/sdk/CHANGELOG.md +33 -0
- package/packages/sdk/LICENSE +21 -0
- package/packages/sdk/README.md +97 -0
- package/packages/sdk/documentation.md +1132 -0
- package/packages/sdk/openapi-ts.config.ts +7 -0
- package/packages/sdk/package.json +88 -0
- package/packages/sdk/src/core/auth.manager.ts +52 -0
- package/packages/sdk/src/core/events/event-bus.ts +301 -0
- package/packages/sdk/src/core/events/index.ts +8 -0
- package/packages/sdk/src/core/events/types.ts +165 -0
- package/packages/sdk/src/core/index.ts +3 -0
- package/packages/sdk/src/core/signal/api.config.ts +49 -0
- package/packages/sdk/src/core/signal/index.ts +16 -0
- package/packages/sdk/src/core/signal/signal.client.ts +101 -0
- package/packages/sdk/src/core/signal/types.ts +110 -0
- package/packages/sdk/src/core/socketio/handlers/base.handler.ts +212 -0
- package/packages/sdk/src/core/socketio/handlers/call-accepted.handler.ts +34 -0
- package/packages/sdk/src/core/socketio/handlers/call-canceled.handler.ts +34 -0
- package/packages/sdk/src/core/socketio/handlers/call-declined.handler.ts +29 -0
- package/packages/sdk/src/core/socketio/handlers/call-ended.handler.ts +40 -0
- package/packages/sdk/src/core/socketio/handlers/call-incoming.handler.ts +72 -0
- package/packages/sdk/src/core/socketio/handlers/call-join-info.handler.ts +181 -0
- package/packages/sdk/src/core/socketio/handlers/call-participant-joined.handler.ts +42 -0
- package/packages/sdk/src/core/socketio/handlers/call-participant-joining.handler.ts +42 -0
- package/packages/sdk/src/core/socketio/handlers/call-timeout.handler.ts +31 -0
- package/packages/sdk/src/core/socketio/handlers/handler.registry.ts +62 -0
- package/packages/sdk/src/core/socketio/handlers/index.ts +21 -0
- package/packages/sdk/src/core/socketio/handlers/participant-left.handler.ts +37 -0
- package/packages/sdk/src/core/socketio/handlers/schema.ts +130 -0
- package/packages/sdk/src/core/socketio/index.ts +5 -0
- package/packages/sdk/src/core/socketio/socket.manager.ts +187 -0
- package/packages/sdk/src/core/socketio/types.ts +14 -0
- package/packages/sdk/src/core/types.ts +23 -0
- package/packages/sdk/src/generated/api/core/ApiError.ts +21 -0
- package/packages/sdk/src/generated/api/core/ApiRequestOptions.ts +13 -0
- package/packages/sdk/src/generated/api/core/ApiResult.ts +7 -0
- package/packages/sdk/src/generated/api/core/CancelablePromise.ts +126 -0
- package/packages/sdk/src/generated/api/core/OpenAPI.ts +55 -0
- package/packages/sdk/src/generated/api/core/request.ts +339 -0
- package/packages/sdk/src/generated/api/index.ts +5 -0
- package/packages/sdk/src/generated/api/models.ts +219 -0
- package/packages/sdk/src/generated/api/services.ts +225 -0
- package/packages/sdk/src/hooks/index.ts +21 -0
- package/packages/sdk/src/hooks/useAutoJoin.ts +66 -0
- package/packages/sdk/src/hooks/useCallActions.ts +28 -0
- package/packages/sdk/src/hooks/useCallQuality.ts +416 -0
- package/packages/sdk/src/hooks/useCallState.ts +23 -0
- package/packages/sdk/src/hooks/useConnection.ts +15 -0
- package/packages/sdk/src/hooks/useDevices.ts +296 -0
- package/packages/sdk/src/hooks/useErrorRecovery.ts +299 -0
- package/packages/sdk/src/hooks/useErrors.ts +84 -0
- package/packages/sdk/src/hooks/useEvent.ts +188 -0
- package/packages/sdk/src/hooks/useMediaControls.ts +215 -0
- package/packages/sdk/src/hooks/useParticipantStatus.ts +318 -0
- package/packages/sdk/src/hooks/useParticipants.ts +111 -0
- package/packages/sdk/src/index.ts +66 -0
- package/packages/sdk/src/livekit/constants.ts +76 -0
- package/packages/sdk/src/livekit/device.manager.ts +172 -0
- package/packages/sdk/src/livekit/error-classifier.ts +155 -0
- package/packages/sdk/src/livekit/events/eventBridge.ts +371 -0
- package/packages/sdk/src/livekit/events/trackRegistry.ts +114 -0
- package/packages/sdk/src/livekit/index.ts +49 -0
- package/packages/sdk/src/livekit/livekit.service.ts +110 -0
- package/packages/sdk/src/livekit/media.controls.ts +315 -0
- package/packages/sdk/src/livekit/room.manager.ts +79 -0
- package/packages/sdk/src/livekit/track.utils.ts +230 -0
- package/packages/sdk/src/livekit/types.ts +135 -0
- package/packages/sdk/src/provider/RtcProvider.tsx +78 -0
- package/packages/sdk/src/services/call-actions.ts +260 -0
- package/packages/sdk/src/services/error-recovery.ts +461 -0
- package/packages/sdk/src/services/index.ts +2 -0
- package/packages/sdk/src/services/sdk-builder.ts +104 -0
- package/packages/sdk/src/state/errors.ts +163 -0
- package/packages/sdk/src/state/selectors.ts +28 -0
- package/packages/sdk/src/state/store.ts +36 -0
- package/packages/sdk/src/state/types.ts +151 -0
- package/packages/sdk/src/utils/logger.ts +183 -0
- package/packages/sdk/tsconfig.json +49 -0
- package/packages/sdk/tsup.config.ts +51 -0
- package/pnpm-workspace.yaml +4 -0
- package/tsconfig.base.json +19 -0
- package/turbo.json +34 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
.participant-tile {
|
|
2
|
+
position: relative;
|
|
3
|
+
background: #1f2937;
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
aspect-ratio: 16/9;
|
|
7
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
8
|
+
transition: all 0.2s ease;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.participant-tile.local {
|
|
12
|
+
border: 2px solid #3b82f6;
|
|
13
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.participant-tile:hover {
|
|
17
|
+
transform: scale(1.02);
|
|
18
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.video-container {
|
|
22
|
+
position: relative;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.participant-video {
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
object-fit: cover;
|
|
34
|
+
background: #1f2937;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.video-placeholder {
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 100%;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.participant-avatar {
|
|
47
|
+
width: 80px;
|
|
48
|
+
height: 80px;
|
|
49
|
+
border-radius: 50%;
|
|
50
|
+
object-fit: cover;
|
|
51
|
+
border: 3px solid rgba(255, 255, 255, 0.2);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.avatar-fallback {
|
|
55
|
+
width: 80px;
|
|
56
|
+
height: 80px;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
color: white;
|
|
63
|
+
font-size: 28px;
|
|
64
|
+
font-weight: 600;
|
|
65
|
+
border: 3px solid rgba(255, 255, 255, 0.2);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.participant-overlay {
|
|
69
|
+
position: absolute;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
left: 0;
|
|
72
|
+
right: 0;
|
|
73
|
+
background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
|
|
74
|
+
padding: 12px;
|
|
75
|
+
display: flex;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
align-items: flex-end;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.participant-name {
|
|
81
|
+
color: white;
|
|
82
|
+
font-size: 14px;
|
|
83
|
+
font-weight: 500;
|
|
84
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
|
85
|
+
max-width: 60%;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
text-overflow: ellipsis;
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.participant-indicators {
|
|
92
|
+
display: flex;
|
|
93
|
+
gap: 4px;
|
|
94
|
+
align-items: center;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.indicator {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
width: 24px;
|
|
102
|
+
height: 24px;
|
|
103
|
+
border-radius: 4px;
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.indicator.muted {
|
|
108
|
+
background: rgba(239, 68, 68, 0.9);
|
|
109
|
+
color: white;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.indicator.video-off {
|
|
113
|
+
background: rgba(107, 114, 128, 0.9);
|
|
114
|
+
color: white;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.indicator.speaking {
|
|
118
|
+
background: rgba(34, 197, 94, 0.9);
|
|
119
|
+
color: white;
|
|
120
|
+
animation: pulse 1.5s ease-in-out infinite;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@keyframes pulse {
|
|
124
|
+
0%, 100% {
|
|
125
|
+
transform: scale(1);
|
|
126
|
+
opacity: 1;
|
|
127
|
+
}
|
|
128
|
+
50% {
|
|
129
|
+
transform: scale(1.1);
|
|
130
|
+
opacity: 0.8;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.indicator.connection-quality {
|
|
135
|
+
background: rgba(0, 0, 0, 0.5);
|
|
136
|
+
padding: 2px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.signal-bars {
|
|
140
|
+
display: flex;
|
|
141
|
+
gap: 1px;
|
|
142
|
+
align-items: flex-end;
|
|
143
|
+
height: 12px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.signal-bars .bar {
|
|
147
|
+
width: 2px;
|
|
148
|
+
background: white;
|
|
149
|
+
border-radius: 1px;
|
|
150
|
+
transition: all 0.2s;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.signal-bars .bar:nth-child(1) {
|
|
154
|
+
height: 4px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.signal-bars .bar:nth-child(2) {
|
|
158
|
+
height: 8px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.signal-bars .bar:nth-child(3) {
|
|
162
|
+
height: 12px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Connection quality states */
|
|
166
|
+
.connection-quality.excellent .bar {
|
|
167
|
+
background: #10b981;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.connection-quality.good .bar:nth-child(1),
|
|
171
|
+
.connection-quality.good .bar:nth-child(2) {
|
|
172
|
+
background: #f59e0b;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.connection-quality.good .bar:nth-child(3) {
|
|
176
|
+
background: #10b981;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.connection-quality.poor .bar:nth-child(1) {
|
|
180
|
+
background: #ef4444;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.connection-quality.poor .bar:nth-child(2),
|
|
184
|
+
.connection-quality.poor .bar:nth-child(3) {
|
|
185
|
+
background: rgba(255, 255, 255, 0.3);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.connection-quality.unknown .bar {
|
|
189
|
+
background: rgba(255, 255, 255, 0.3);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Responsive adjustments */
|
|
193
|
+
@media (max-width: 768px) {
|
|
194
|
+
.participant-avatar,
|
|
195
|
+
.avatar-fallback {
|
|
196
|
+
width: 60px;
|
|
197
|
+
height: 60px;
|
|
198
|
+
font-size: 20px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.participant-name {
|
|
202
|
+
font-size: 12px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.indicator {
|
|
206
|
+
width: 20px;
|
|
207
|
+
height: 20px;
|
|
208
|
+
font-size: 10px;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
import type { Participant } from 'vg-x07df';
|
|
3
|
+
import './ParticipantTile.css';
|
|
4
|
+
|
|
5
|
+
interface ParticipantTileProps {
|
|
6
|
+
participant: Participant;
|
|
7
|
+
isLocal?: boolean;
|
|
8
|
+
videoTrack?: MediaStreamTrack | null;
|
|
9
|
+
isMuted?: boolean;
|
|
10
|
+
isVideoEnabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function ParticipantTile({
|
|
15
|
+
participant,
|
|
16
|
+
isLocal = false,
|
|
17
|
+
videoTrack,
|
|
18
|
+
isMuted = false,
|
|
19
|
+
isVideoEnabled = true,
|
|
20
|
+
className = ''
|
|
21
|
+
}: ParticipantTileProps) {
|
|
22
|
+
const videoRef = useRef<HTMLVideoElement>(null);
|
|
23
|
+
|
|
24
|
+
// Handle video track
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!videoRef.current || !videoTrack) return;
|
|
27
|
+
|
|
28
|
+
const videoElement = videoRef.current;
|
|
29
|
+
const stream = new MediaStream([videoTrack]);
|
|
30
|
+
videoElement.srcObject = stream;
|
|
31
|
+
|
|
32
|
+
return () => {
|
|
33
|
+
videoElement.srcObject = null;
|
|
34
|
+
};
|
|
35
|
+
}, [videoTrack]);
|
|
36
|
+
|
|
37
|
+
const displayName = [participant.firstName, participant.lastName]
|
|
38
|
+
.filter(Boolean)
|
|
39
|
+
.join(' ') || `User ${participant.id}`;
|
|
40
|
+
|
|
41
|
+
const getAvatarFallback = () => {
|
|
42
|
+
if (participant.firstName && participant.lastName) {
|
|
43
|
+
return `${participant.firstName.charAt(0)}${participant.lastName.charAt(0)}`.toUpperCase();
|
|
44
|
+
}
|
|
45
|
+
if (participant.firstName) {
|
|
46
|
+
return participant.firstName.charAt(0).toUpperCase();
|
|
47
|
+
}
|
|
48
|
+
return displayName.charAt(0).toUpperCase();
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div className={`participant-tile ${isLocal ? 'local' : ''} ${className}`}>
|
|
53
|
+
<div className="video-container">
|
|
54
|
+
{isVideoEnabled && videoTrack ? (
|
|
55
|
+
<video
|
|
56
|
+
ref={videoRef}
|
|
57
|
+
autoPlay
|
|
58
|
+
playsInline
|
|
59
|
+
muted={isLocal} // Always mute local video to prevent feedback
|
|
60
|
+
className="participant-video"
|
|
61
|
+
/>
|
|
62
|
+
) : (
|
|
63
|
+
<div className="video-placeholder">
|
|
64
|
+
{participant.avatarUrl ? (
|
|
65
|
+
<img src={participant.avatarUrl} alt={displayName} className="participant-avatar" />
|
|
66
|
+
) : (
|
|
67
|
+
<div className="avatar-fallback">
|
|
68
|
+
{getAvatarFallback()}
|
|
69
|
+
</div>
|
|
70
|
+
)}
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
|
|
74
|
+
{/* Overlay indicators */}
|
|
75
|
+
<div className="participant-overlay">
|
|
76
|
+
<div className="participant-name">
|
|
77
|
+
{displayName}
|
|
78
|
+
{isLocal && ' (You)'}
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div className="participant-indicators">
|
|
82
|
+
{isMuted && (
|
|
83
|
+
<div className="indicator muted">
|
|
84
|
+
<span className="icon">🔇</span>
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
|
|
88
|
+
{!isVideoEnabled && (
|
|
89
|
+
<div className="indicator video-off">
|
|
90
|
+
<span className="icon">📹</span>
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
93
|
+
|
|
94
|
+
{participant.isSpeaking && (
|
|
95
|
+
<div className="indicator speaking">
|
|
96
|
+
<span className="icon">🗣️</span>
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
|
|
100
|
+
{participant.connectionQuality && (
|
|
101
|
+
<div className={`indicator connection-quality ${participant.connectionQuality.toLowerCase()}`}>
|
|
102
|
+
<div className="signal-bars">
|
|
103
|
+
<div className="bar"></div>
|
|
104
|
+
<div className="bar"></div>
|
|
105
|
+
<div className="bar"></div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
)}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
.video-conference {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.conference-content {
|
|
10
|
+
flex: 1;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.video-area {
|
|
17
|
+
flex: 1;
|
|
18
|
+
padding: 16px;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.call-connecting {
|
|
25
|
+
flex: 1;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
background: rgba(0, 0, 0, 0.3);
|
|
30
|
+
backdrop-filter: blur(20px);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.connecting-content {
|
|
34
|
+
text-align: center;
|
|
35
|
+
color: white;
|
|
36
|
+
max-width: 400px;
|
|
37
|
+
padding: 40px 20px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.connecting-icon {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
width: 120px;
|
|
46
|
+
height: 120px;
|
|
47
|
+
margin-bottom: 32px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.pulse-ring {
|
|
51
|
+
position: absolute;
|
|
52
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
animation: pulse-ring 2s cubic-bezier(0.25, 0, 0, 1) infinite;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pulse-ring.delay-1 {
|
|
60
|
+
animation-delay: 0.4s;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.pulse-ring.delay-2 {
|
|
64
|
+
animation-delay: 0.8s;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes pulse-ring {
|
|
68
|
+
0% {
|
|
69
|
+
transform: scale(0.8);
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
72
|
+
100% {
|
|
73
|
+
transform: scale(1.4);
|
|
74
|
+
opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.call-icon {
|
|
79
|
+
position: relative;
|
|
80
|
+
font-size: 48px;
|
|
81
|
+
z-index: 1;
|
|
82
|
+
animation: float 3s ease-in-out infinite;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@keyframes float {
|
|
86
|
+
0%, 100% {
|
|
87
|
+
transform: translateY(0);
|
|
88
|
+
}
|
|
89
|
+
50% {
|
|
90
|
+
transform: translateY(-10px);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.connecting-content h2 {
|
|
95
|
+
font-size: 24px;
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
margin: 0 0 12px 0;
|
|
98
|
+
color: white;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.connecting-content p {
|
|
102
|
+
font-size: 16px;
|
|
103
|
+
margin: 0 0 24px 0;
|
|
104
|
+
color: rgba(255, 255, 255, 0.8);
|
|
105
|
+
line-height: 1.5;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.connecting-dots {
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
gap: 8px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.connecting-dots .dot {
|
|
115
|
+
width: 8px;
|
|
116
|
+
height: 8px;
|
|
117
|
+
background: rgba(255, 255, 255, 0.6);
|
|
118
|
+
border-radius: 50%;
|
|
119
|
+
animation: bounce-dots 1.4s ease-in-out infinite both;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.connecting-dots .dot:nth-child(1) {
|
|
123
|
+
animation-delay: -0.32s;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.connecting-dots .dot:nth-child(2) {
|
|
127
|
+
animation-delay: -0.16s;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@keyframes bounce-dots {
|
|
131
|
+
0%, 80%, 100% {
|
|
132
|
+
transform: scale(0.8);
|
|
133
|
+
opacity: 0.5;
|
|
134
|
+
}
|
|
135
|
+
40% {
|
|
136
|
+
transform: scale(1.2);
|
|
137
|
+
opacity: 1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Responsive design */
|
|
142
|
+
@media (max-width: 768px) {
|
|
143
|
+
.video-area {
|
|
144
|
+
padding: 8px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.connecting-content {
|
|
148
|
+
padding: 20px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.connecting-icon {
|
|
152
|
+
width: 80px;
|
|
153
|
+
height: 80px;
|
|
154
|
+
margin-bottom: 24px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.call-icon {
|
|
158
|
+
font-size: 32px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.connecting-content h2 {
|
|
162
|
+
font-size: 20px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.connecting-content p {
|
|
166
|
+
font-size: 14px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@media (max-width: 480px) {
|
|
171
|
+
.video-area {
|
|
172
|
+
padding: 4px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.connecting-content {
|
|
176
|
+
padding: 16px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.connecting-icon {
|
|
180
|
+
width: 60px;
|
|
181
|
+
height: 60px;
|
|
182
|
+
margin-bottom: 16px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.call-icon {
|
|
186
|
+
font-size: 24px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.connecting-content h2 {
|
|
190
|
+
font-size: 18px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.connecting-content p {
|
|
194
|
+
font-size: 13px;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Fullscreen mode adjustments */
|
|
199
|
+
.video-conference:fullscreen {
|
|
200
|
+
background: #000;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.video-conference:fullscreen .conference-header {
|
|
204
|
+
display: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.video-conference:fullscreen .video-area {
|
|
208
|
+
padding: 0;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.video-conference:fullscreen .participant-grid {
|
|
212
|
+
border-radius: 0;
|
|
213
|
+
background: #000;
|
|
214
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { useCallState, useAutoJoinForCurrentUser, useSdk } from 'vg-x07df';
|
|
2
|
+
import { ConferenceHeader } from './ConferenceHeader';
|
|
3
|
+
import { ParticipantGrid } from './ParticipantGrid';
|
|
4
|
+
import { EnhancedControlBar } from './EnhancedControlBar';
|
|
5
|
+
import './VideoConference.css';
|
|
6
|
+
|
|
7
|
+
interface VideoConferenceProps {
|
|
8
|
+
onLeaveCall?: () => void;
|
|
9
|
+
onMinimize?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function VideoConference({ onLeaveCall, onMinimize }: VideoConferenceProps) {
|
|
13
|
+
const { status } = useCallState();
|
|
14
|
+
const sdk = useSdk();
|
|
15
|
+
const autoJoinState = sdk.store((state) => state.autoJoin);
|
|
16
|
+
const userAutoJoin = useAutoJoinForCurrentUser();
|
|
17
|
+
|
|
18
|
+
const handleMinimize = () => {
|
|
19
|
+
onMinimize?.();
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const handleFullscreen = () => {
|
|
23
|
+
if (document.fullscreenElement) {
|
|
24
|
+
document.exitFullscreen();
|
|
25
|
+
} else {
|
|
26
|
+
document.documentElement.requestFullscreen();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const handleLeaveCall = () => {
|
|
31
|
+
onLeaveCall?.();
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
if (status === 'IDLE' || status === 'ENDED') {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className="video-conference">
|
|
40
|
+
<ConferenceHeader
|
|
41
|
+
onMinimize={handleMinimize}
|
|
42
|
+
onFullscreen={handleFullscreen}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<div className="conference-content">
|
|
46
|
+
{status === 'CALLING' || status === 'RINGING' || status === 'ACCEPTED' || status === 'AWAITING_JOIN_INFO' || status === 'READY_TO_JOIN' || status === 'CONNECTING' ? (
|
|
47
|
+
<div className="call-connecting">
|
|
48
|
+
<div className="connecting-content">
|
|
49
|
+
<div className="connecting-icon">
|
|
50
|
+
<div className="pulse-ring"></div>
|
|
51
|
+
<div className="pulse-ring delay-1"></div>
|
|
52
|
+
<div className="pulse-ring delay-2"></div>
|
|
53
|
+
<span className="call-icon">📞</span>
|
|
54
|
+
</div>
|
|
55
|
+
<h2>Connecting to call...</h2>
|
|
56
|
+
<p>
|
|
57
|
+
{status === 'CALLING' && 'Calling participants...'}
|
|
58
|
+
{status === 'RINGING' && 'Ringing participants...'}
|
|
59
|
+
{status === 'ACCEPTED' && 'Call accepted, joining room...'}
|
|
60
|
+
{status === 'AWAITING_JOIN_INFO' && 'Getting room information...'}
|
|
61
|
+
{status === 'READY_TO_JOIN' && 'Preparing to join...'}
|
|
62
|
+
{status === 'CONNECTING' && 'Joining media session...'}
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
{/* Show current auto-join status */}
|
|
66
|
+
{userAutoJoin.shouldAutoJoin && autoJoinState.status !== 'idle' && (
|
|
67
|
+
<div className="mt-4 text-sm opacity-75">
|
|
68
|
+
{autoJoinState.status === 'pending' && '⏳ Auto-joining...'}
|
|
69
|
+
{autoJoinState.status === 'retrying' && `🔄 Retrying... (${autoJoinState.attempt}/${autoJoinState.maxAttempts})`}
|
|
70
|
+
{autoJoinState.status === 'failed' && '⚠️ Auto-join failed'}
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
|
|
74
|
+
<div className="connecting-dots">
|
|
75
|
+
<span className="dot"></span>
|
|
76
|
+
<span className="dot"></span>
|
|
77
|
+
<span className="dot"></span>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
) : (
|
|
82
|
+
<div className="video-area">
|
|
83
|
+
<ParticipantGrid />
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
{status === 'ACTIVE' && (
|
|
89
|
+
<EnhancedControlBar onLeaveCall={handleLeaveCall} />
|
|
90
|
+
)}
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|