-
Notifications
You must be signed in to change notification settings - Fork 0
Screen Sharing Quick Reference
github-actions[bot] edited this page Feb 23, 2026
·
1 revision
import { useScreenShare } from '@/hooks/use-screen-share'
const { isScreenSharing, startScreenShare, stopScreenShare } = useScreenShare({
userId: 'user-id',
userName: 'User Name',
})
// Start
await startScreenShare({ quality: '1080p' })
// Stop
stopScreenShare()| Component | Purpose | Path |
|---|---|---|
ScreenSharePanel |
Full screen share UI | @/components/call/screen-share-panel |
AnnotationToolbar |
Drawing tools | @/components/call/annotation-toolbar |
CallModal |
Integrated call UI | @/components/call/call-modal |
| Hook | Purpose |
|---|---|
useScreenShare |
Screen sharing lifecycle |
useScreenRecording |
Recording management |
| Class | Purpose |
|---|---|
ScreenCaptureManager |
Capture screen/window/tab |
ScreenAnnotator |
Draw annotations |
CursorHighlighter |
Track cursors |
ScreenRecorder |
Record screen shares |
- Pen - Freehand drawing
- Arrow - Point to areas
- Line - Straight lines
- Rectangle - Draw boxes
- Circle - Draw circles
- Text - Add labels
- Eraser - Remove annotations
| Quality | Resolution | FPS | Bitrate |
|---|---|---|---|
| 720p | 1280x720 | 30 | 1.5 Mbps |
| 1080p | 1920x1080 | 30 | 2.5 Mbps |
| 4K | 3840x2160 | 60 | 8 Mbps |
await startRecording(stream, {
format: 'webm', // or 'mp4'
quality: 'high', // 'low', 'medium', 'high'
includeWebcam: true, // Add webcam overlay
webcamSize: 'small', // 'small', 'medium', 'large'
webcamPosition: 'bottom-right', // 4 corners
})| Browser | Support | System Audio |
|---|---|---|
| Chrome 72+ | β Full | β Yes |
| Edge 79+ | β Full | β Yes |
| Firefox 66+ | β Full | β No |
| Safari 13+ | β No |
// Adaptive quality based on network
const quality = getOptimalQuality(networkSpeed)
// Lower frame rate for better performance
await startScreenShare({ frameRate: 15 })
// Update quality dynamically
await updateQuality(shareId, '720p')// Always check permissions
if (!ScreenCaptureManager.isSupported()) {
// Show error
}
// Handle permission denial
try {
await startScreenShare()
} catch (error) {
if (error.name === 'NotAllowedError') {
// User denied
}
}| Error | Cause | Solution |
|---|---|---|
NotAllowedError |
Permission denied | Request permission again |
NotFoundError |
No screen selected | User must select a screen |
NotSupportedError |
Browser doesn't support | Use Chrome/Edge/Firefox |
const captureManager = createScreenCaptureManager({
onStreamStarted: (stream) => {
// Stream started
},
onStreamEnded: (streamId) => {
// Stream ended
},
onError: (error) => {
// Handle error
},
onTrackEnded: (kind) => {
// Track ended (video/audio)
},
})await startScreenShare({
quality: '1080p',
captureSystemAudio: true,
captureCursor: true,
})await startRecording(screenStream, {
includeWebcam: true,
webcamPosition: 'bottom-right',
})annotator.setTool('pen')
annotator.setColor('#FF0000')
annotator.setStrokeWidth(4)highlighter.updateCursor({
x: 100,
y: 200,
userId: 'user-id',
userName: 'User Name',
timestamp: Date.now(),
})<CallModal
isScreenSharing={isScreenSharing}
onToggleScreenShare={() => {
if (isScreenSharing) {
stopScreenShare()
} else {
startScreenShare()
}
}}
currentUserId={user.id}
currentUserName={user.name}
{...otherProps}
/># Check TypeScript
npx tsc --noEmit
# Run tests
pnpm test src/lib/webrtc
# Manual test
pnpm dev
# Navigate to /call-test- Issues: https://github.com/yourusername/nself-chat/issues
- Docs: https://docs.nself.org
- Email: support@nself.org
nself-chat v0.3.0 | GitHub | Issues | Discussions | Demo
Edit this page | MIT License | Β© 2026
(See π Security section below for 2FA, PIN Lock, and security audits.)
(Search lives in π Reference below.)
- π¬ Advanced Messaging
- π E2EE Setup
- π Search Setup
- π Call Management
- πΊ Live Streaming
- π₯οΈ Screen Sharing
- πΉ Video Calling
- ποΈ Voice Calling
- π± Mobile Optimization
- π§ͺ Testing
- π i18n
- π API Overview
- π Complete Reference
- π» API Examples
- π€ Bot API
- π Auth API
- π GraphQL Schema
- π Deployment Overview
- π³ Docker
- βΈοΈ Kubernetes
- β Helm Charts
- β Production Checklist
- π Production Validation
- π’ Multi-Tenant
- ποΈ Architecture
- π Diagrams
- ποΈ Database Schema
- π Project Structure
- π TypeScript Types
- π SPORT Reference
- π 2FA
- π¬ Messaging
- π Call Management
- π Call State Machine
- π E2EE
- πΊ Live Streaming
- π± Mobile Calls
- π PIN Lock
- π Polls
- π₯οΈ Screen Sharing
- π Search
- π Social Media
- ποΈ Voice Calling
- π Security Overview
- π‘οΈ Security Audit
- β‘ Performance
- π Best Practices
- π 2FA
- π PIN Lock
- π E2EE
- π‘οΈ E2EE Audit
v1.0.0 β’ 2026