Made it so that you can play files through FFplay.

This commit is contained in:
2025-06-07 23:43:32 +05:00
parent 57637606c0
commit 6e8b148c81
2 changed files with 22 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import (
type FFplayContract interface {
GetPath() string
Play(file *File) error
}
type ffplay struct {
@@ -38,6 +39,13 @@ func (f *ffplay) GetPath() string {
return f.path
}
func (f *ffplay) Play(file *File) error {
args := []string{file.Path}
cmd := exec.Command(f.GetPath(), args...)
return cmd.Run()
}
func checkFFplayPath(path string) (bool, error) {
cmd := exec.Command(path, "-version")
utils.PrepareBackgroundCommand(cmd)