live-streamer/utils/is_supported_video.go

14 lines
277 B
Go
Raw Permalink Normal View History

2024-10-22 16:39:10 -04:00
package utils
import (
"live-streamer/constant"
"path/filepath"
"slices"
"strings"
)
func IsSupportedVideo(filename string) bool {
ext := strings.ToLower(filepath.Ext(filename))
return slices.Contains(constant.SupportedStreamingFormats, strings.TrimPrefix(ext, "."))
}