Espelhamento de tela (captura + WebRTC + prévia com retângulo)

Đang mở
#1,218 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
40/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Start from index.ts to see how public exports are declared and where a new createScreenCapture entry point would sit, then look at ./map, ./kit and VideoPlayer for the existing component and injection conventions, and at #668 to confirm voice/video rooms are separate. The acceptance criteria in the issue double as the test file: mock getDisplayMedia and RTCPeerConnection, assert video.cursor, setFocusBehavior ordering, NotAllowedError rejection, and addTrack per track. Done means those five checks pass plus a <TrackPreview> whose arrow keys step 1% and whose aria-valuetext reports the region in px. Expect to design the API shape before writing it.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:components area:perf enhancement

Versão: @codeatlasdev/ui 4.6.0 · código lido em main (950628f2) · classe: lacuna (migração do AC)

Problema

O AC depende deste comportamento hoje e a lib não o oferece. Sem ele, a migração perde qualidade no desktop, no mobile ou no PWA.

O que a lib já oferece (para não duplicar) e o que falta

(leitura de origin/main, index.ts sem exports de captura) não há getDisplayMedia, WebRTC nem prévia de track. ./map, ./kit e VideoPlayer não cobrem. #668 cobre salas de voz/vídeo (StageGrid, CallControls), mas não captura de tela.

Referência no AC

Caminhos do repo AC (repo privado, só caminho):

apps/web/src/lib/cast/sender.ts:56-104 (CastSender, captureDisplay), :201-205 (new RTCPeerConnection, addTrack), sender-encoder.ts:16-19 (navigator.mediaDevices.getDisplayMedia), sender-encoder.ts:37 (preferH264), constraints.ts:61-65 (1080p, dicas Chromium), capture-controller.ts:36-51 (setFocusBehavior só após getDisplayMedia); components/videowall-cast/cast-area-picker.tsx:115-120, 177-185 (prévia <video> do track, retângulo de 1 px = 1 px da TV).

Defeitos do AC (verificados por leitura do código): (leitura) o retângulo de área só se move com ponteiro (cast-area-picker.tsx:177-179). Há alternativa por rádio (Centro, Esquerda, Direita), mas não por teclado para posição fina.

Proposta

createScreenCapture({ hint: 'motion'|'detail', cursor, maxSize: {w:1920,h:1080} }) (headless, injetável: getDisplayMedia e RTCPeerConnection) e <TrackPreview track bind:region> com retângulo arrastável e teclado. Estatísticas e H.264 como opções.

Critério de aceite (testável)

  • Com getDisplayMedia injetado, createScreenCapture chama a função com video.cursor always quando cursor=true e never quando false.
  • setFocusBehavior é chamado só depois do retorno de getDisplayMedia; se lançar, o stream segue e o motivo vai só para debug.
  • Recusa do usuário (NotAllowedError) rejeita a promessa sem tocar no controlador.
  • <TrackPreview> com retângulo: setas movem em passos de 1% e o aria-valuetext diz a área em px.
  • Em teste, RTCPeerConnection injetado recebe addTrack para cada track do stream.

Mãe: #1089

Ngôn ngữ chính
TypeScript
Star
6
Fork
3
Merge trung bình
5 giờ 21 phút
Pull request đã merge (30 ngày)
378

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codeatlasdev/ui

Tất cả issue của codeatlasdev/ui

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.