Add FFplay support to the application

Integrated FFplay functionality across the application. This includes support for setting up the FFplay path and invoking FFplay for media playback.
This commit is contained in:
2025-05-19 22:49:09 +05:00
parent a831d56d93
commit 306383449a
17 changed files with 244 additions and 24 deletions

30
kernel/ffplay.go Normal file
View File

@@ -0,0 +1,30 @@
package kernel
import (
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/helper"
"os/exec"
)
type FFplay struct {
ffPathUtilities *FFPathUtilities
}
type FFplaySetting struct {
PathToFile string
}
type FFplayContract interface {
Run(setting FFplaySetting) error
}
func NewFFplay(ffPathUtilities *FFPathUtilities) *FFplay {
return &FFplay{ffPathUtilities: ffPathUtilities}
}
func (ffplay FFplay) Run(setting FFplaySetting) error {
args := []string{setting.PathToFile}
cmd := exec.Command(ffplay.ffPathUtilities.FFplay, args...)
helper.PrepareBackgroundCommand(cmd)
return cmd.Start()
}