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:
30
kernel/ffplay.go
Normal file
30
kernel/ffplay.go
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user