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:
@@ -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")
|
||||
}
|
||||
Reference in New Issue
Block a user