Init
This commit is contained in:
8
utils/has_ffmpeg.go
Normal file
8
utils/has_ffmpeg.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package utils
|
||||
|
||||
import "os/exec"
|
||||
|
||||
func HasFFMPEG() bool {
|
||||
_, err := exec.LookPath("ffmpeg")
|
||||
return err == nil
|
||||
}
|
||||
13
utils/is_supported_video.go
Normal file
13
utils/is_supported_video.go
Normal file
@@ -0,0 +1,13 @@
|
||||
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, "."))
|
||||
}
|
||||
Reference in New Issue
Block a user