Made it so that you can play files through FFplay.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user