Made it so that you can play files through FFplay.

This commit is contained in:
Leonid Nikitin 2025-06-07 23:43:32 +05:00
parent 57637606c0
commit 6e8b148c81
Signed by: kor-elf
GPG Key ID: DAB5355A11C22541
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)

View File

@ -4,8 +4,22 @@ import (
"errors"
"fyne.io/fyne/v2/lang"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/application/setting"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/ffmpeg/encoder"
)
type File struct {
Path string
Name string
Ext string
}
type ConvertSetting struct {
VideoFileInput File
VideoFileOut File
OverwriteOutputFiles bool
Encoder encoder.EncoderContract
}
type UtilitiesContract interface {
UtilityCheck() bool