Integrated FFplay functionality across the application. This includes support for setting up the FFplay path and invoking FFplay for media playback.
		
			
				
	
	
		
			31 lines
		
	
	
		
			593 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			593 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 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()
 | |
| }
 |