docs: issues técnicas para nuevas funcionalidades
Agrega 19 issues técnicas documentando funcionalidades implementadas y pendientes. Issues completadas (movidas a dev/issues/completed/): - 001-conversor-web-markdown.md - 002-accessibility-tree.md - 003-gestion-cookies-perfil.md - 004-gestion-extensiones-chrome.md - 005-eliminar-timeouts-innecesarios.md Issues implementadas: - 006-manejo-tabs-ventanas.md - 016-manejo-iframes.md - 017-actions-api.md - 018-file-uploads.md - 019-expected-conditions-mejoradas.md Issues pendientes (media prioridad): - 007-alert-prompt-confirm-handling.md - 008-screenshot-elementos-especificos.md - 009-pdf-generation.md - 010-device-emulation-completo.md - 011-downloads-handling.md Issues pendientes (baja prioridad / avanzado): - 012-browser-contexts-multi-sesion.md - 013-video-recording.md - 014-network-mocking-avanzado.md - 015-geolocation-permissions.md Incluye también dev/NUEVAS_FUNCIONALIDADES.md con resumen completo. Directorio: dev/
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
# Issue #013: Video Recording
|
||||
|
||||
**Tipo**: Enhancement
|
||||
**Prioridad**: Baja (Avanzado)
|
||||
**Estado**: Pendiente
|
||||
|
||||
## Descripción
|
||||
|
||||
Implementar grabación de video de la sesión del navegador.
|
||||
|
||||
## Funcionalidad deseada
|
||||
|
||||
- Grabar video de la sesión completa
|
||||
- Configurar resolución y FPS
|
||||
- Guardar en formato MP4/WebM
|
||||
- Start/stop recording bajo demanda
|
||||
- Capturar audio (opcional)
|
||||
|
||||
## API propuesta
|
||||
|
||||
```go
|
||||
type VideoOptions struct {
|
||||
OutputPath string
|
||||
Width int
|
||||
Height int
|
||||
FPS int // Frames per second (default: 25)
|
||||
Format string // "mp4" | "webm"
|
||||
AudioCodec string // "opus" | "aac" | ""
|
||||
}
|
||||
|
||||
func (b *Browser) StartRecording(ctx context.Context, opts *VideoOptions) error
|
||||
func (b *Browser) StopRecording(ctx context.Context) (string, error)
|
||||
func (b *Browser) PauseRecording(ctx context.Context) error
|
||||
func (b *Browser) ResumeRecording(ctx context.Context) error
|
||||
```
|
||||
|
||||
## Uso
|
||||
|
||||
```go
|
||||
opts := &browser.VideoOptions{
|
||||
OutputPath: "./recordings/session.mp4",
|
||||
Width: 1280,
|
||||
Height: 720,
|
||||
FPS: 30,
|
||||
}
|
||||
|
||||
b.StartRecording(ctx, opts)
|
||||
|
||||
// Realizar acciones
|
||||
b.Navigate(ctx, "https://example.com", nil)
|
||||
b.Click(ctx, "#button")
|
||||
|
||||
// Detener y guardar
|
||||
videoPath, _ := b.StopRecording(ctx)
|
||||
log.Printf("Video saved: %s", videoPath)
|
||||
```
|
||||
|
||||
## Implementación
|
||||
|
||||
### Opción 1: CDP Screencast (screenshots en loop)
|
||||
```go
|
||||
// Capturar frames continuamente
|
||||
b.cdpClient.On("Page.screencastFrame", func(params json.RawMessage) {
|
||||
// Guardar frame
|
||||
// Compilar a video con ffmpeg
|
||||
})
|
||||
|
||||
b.cdpClient.SendCommand(ctx, "Page.startScreencast", map[string]interface{}{
|
||||
"format": "jpeg",
|
||||
"quality": 80,
|
||||
"maxWidth": 1280,
|
||||
"maxHeight": 720,
|
||||
"everyNthFrame": 1,
|
||||
})
|
||||
```
|
||||
|
||||
### Opción 2: External tool (ffmpeg)
|
||||
```bash
|
||||
# Usar ffmpeg para capturar X11 display
|
||||
ffmpeg -video_size 1280x720 -framerate 25 -f x11grab -i :99 output.mp4
|
||||
```
|
||||
|
||||
### Opción 3: Chrome --use-file-for-fake-video-capture
|
||||
```go
|
||||
// Grabar con flags de Chrome
|
||||
config.ChromeFlags = append(config.ChromeFlags,
|
||||
"--use-file-for-fake-video-capture=/dev/video0",
|
||||
)
|
||||
```
|
||||
|
||||
## CDP Methods
|
||||
|
||||
- `Page.startScreencast`
|
||||
- `Page.screencastFrame` (evento)
|
||||
- `Page.stopScreencast`
|
||||
- `Page.screencastFrameAck`
|
||||
|
||||
## Consideraciones
|
||||
|
||||
- **Performance**: Recording consume CPU/memoria
|
||||
- **Tamaño**: Videos pueden ser grandes
|
||||
- **Headless**: Requiere Xvfb o display virtual
|
||||
- **Codec**: Necesita ffmpeg o herramienta externa
|
||||
|
||||
## Referencias
|
||||
|
||||
- CDP Page.startScreencast: https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-startScreencast
|
||||
- Playwright video: https://playwright.dev/docs/videos
|
||||
- Puppeteer video: https://github.com/puppeteer/puppeteer/issues/448
|
||||
Reference in New Issue
Block a user