Major improvements to UnifiedPlayer: 1. GetFrameImage() now works when paused for responsive UI updates 2. Play() method properly starts FFmpeg process 3. Frame display loop runs continuously for smooth video display 4. Disabled audio temporarily to fix video playback fundamentals 5. Simplified FFmpeg command to focus on video stream only Player now: - Generates video frames correctly - Shows video when paused - Has responsive progress tracking - Starts playback properly Next steps: Re-enable audio playback once video is stable
37 lines
826 B
Go
37 lines
826 B
Go
package internal
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/nicksnyder/go-i18n/v2/i18n/template"
|
|
)
|
|
|
|
// Template stores the template for a string and a cached version of the parsed template if they are cacheable.
|
|
type Template struct {
|
|
Src string
|
|
LeftDelim string
|
|
RightDelim string
|
|
|
|
parseOnce sync.Once
|
|
parsedTemplate template.ParsedTemplate
|
|
parseError error
|
|
}
|
|
|
|
func (t *Template) Execute(parser template.Parser, data interface{}) (string, error) {
|
|
var pt template.ParsedTemplate
|
|
var err error
|
|
if parser.Cacheable() {
|
|
t.parseOnce.Do(func() {
|
|
t.parsedTemplate, t.parseError = parser.Parse(t.Src, t.LeftDelim, t.RightDelim)
|
|
})
|
|
pt, err = t.parsedTemplate, t.parseError
|
|
} else {
|
|
pt, err = parser.Parse(t.Src, t.LeftDelim, t.RightDelim)
|
|
}
|
|
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return pt.Execute(data)
|
|
}
|