Add webcam functionality to the agent's API and web interface. Implement endpoints for listing available webcams and capturing frames, along with corresponding UI elements for device selection and frame display. Update OpenAPI specification to include new webcam features, enhancing user interaction with webcam devices.

This commit is contained in:
2026-08-29 18:34:05 +03:00
parent 421c83afd2
commit dece8b3ebe
9 changed files with 549 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
//go:build !windows
package webcam
import (
"errors"
"tea.chunkbyte.com/kato/go-worm/lib/models"
)
var ErrDeviceNotFound = errors.New("webcam not found")
type Device struct {
Index int `json:"index"`
Name string `json:"name"`
Version string `json:"version,omitempty"`
}
func List() ([]Device, error) {
return nil, errors.New("webcam is only available on Windows")
}
func Capture(index int, format string, quality int) (models.CapturedImage, error) {
return models.CapturedImage{}, errors.New("webcam is only available on Windows")
}