Made it so that you can play files through FFplay.
This commit is contained in:
parent
57637606c0
commit
6e8b148c81
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
type FFplayContract interface {
|
type FFplayContract interface {
|
||||||
GetPath() string
|
GetPath() string
|
||||||
|
Play(file *File) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type ffplay struct {
|
type ffplay struct {
|
||||||
@ -38,6 +39,13 @@ func (f *ffplay) GetPath() string {
|
|||||||
return f.path
|
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) {
|
func checkFFplayPath(path string) (bool, error) {
|
||||||
cmd := exec.Command(path, "-version")
|
cmd := exec.Command(path, "-version")
|
||||||
utils.PrepareBackgroundCommand(cmd)
|
utils.PrepareBackgroundCommand(cmd)
|
||||||
|
@ -4,8 +4,22 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fyne.io/fyne/v2/lang"
|
"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/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 {
|
type UtilitiesContract interface {
|
||||||
UtilityCheck() bool
|
UtilityCheck() bool
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user