Add video as a media kind in photos: streaming upload with per-kind limits, ffprobe metadata, poster frame reusing the image variant pipeline, and a playback object (remux when web-compatible, else h264/yuv420p/aac transcode). Video jobs run on a separate pool with a long lease. Frontend gains a video viewer, grid badge/duration and video upload.
17 lines
399 B
Go
17 lines
399 B
Go
package photos
|
|
|
|
// Media kinds. A photo row may describe either a still image or a video.
|
|
const (
|
|
KindImage = "image"
|
|
KindVideo = "video"
|
|
)
|
|
|
|
// mediaKind normalizes a photo kind, defaulting to image. It is used before
|
|
// persisting so the column and the variant job always carry a valid value.
|
|
func mediaKind(kind string) string {
|
|
if kind == KindVideo {
|
|
return KindVideo
|
|
}
|
|
return KindImage
|
|
}
|