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
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package layout
|
|
|
|
import "fyne.io/fyne/v2"
|
|
|
|
// Declare conformity with Layout interface
|
|
var _ fyne.Layout = (*centerLayout)(nil)
|
|
|
|
type centerLayout struct{}
|
|
|
|
// NewCenterLayout creates a new CenterLayout instance
|
|
func NewCenterLayout() fyne.Layout {
|
|
return ¢erLayout{}
|
|
}
|
|
|
|
// Layout is called to pack all child objects into a specified size.
|
|
// For CenterLayout this sets all children to their minimum size, centered within the space.
|
|
func (c *centerLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
|
|
for _, child := range objects {
|
|
childMin := child.MinSize()
|
|
child.Resize(childMin)
|
|
child.Move(fyne.NewPos((size.Width-childMin.Width)/2, (size.Height-childMin.Height)/2))
|
|
}
|
|
}
|
|
|
|
// MinSize finds the smallest size that satisfies all the child objects.
|
|
// For CenterLayout this is determined simply as the MinSize of the largest child.
|
|
func (c *centerLayout) MinSize(objects []fyne.CanvasObject) fyne.Size {
|
|
minSize := fyne.NewSize(0, 0)
|
|
for _, child := range objects {
|
|
if !child.Visible() {
|
|
continue
|
|
}
|
|
|
|
minSize = minSize.Max(child.MinSize())
|
|
}
|
|
|
|
return minSize
|
|
}
|