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
54 lines
1.8 KiB
Go
54 lines
1.8 KiB
Go
package dialog
|
|
|
|
import (
|
|
"unicode"
|
|
"unicode/utf8"
|
|
|
|
"fyne.io/fyne/v2"
|
|
"fyne.io/fyne/v2/container"
|
|
"fyne.io/fyne/v2/lang"
|
|
"fyne.io/fyne/v2/theme"
|
|
"fyne.io/fyne/v2/widget"
|
|
)
|
|
|
|
func createInformationDialog(title, message string, icon fyne.Resource, parent fyne.Window) Dialog {
|
|
d := newTextDialog(title, message, icon, parent)
|
|
d.dismiss = &widget.Button{
|
|
Text: lang.L("OK"),
|
|
OnTapped: d.Hide,
|
|
}
|
|
d.create(container.NewGridWithColumns(1, d.dismiss))
|
|
return d
|
|
}
|
|
|
|
// NewInformation creates a dialog over the specified window for user information.
|
|
// The title is used for the dialog window and message is the content.
|
|
// After creation you should call Show().
|
|
func NewInformation(title, message string, parent fyne.Window) Dialog {
|
|
return createInformationDialog(title, message, theme.InfoIcon(), parent)
|
|
}
|
|
|
|
// ShowInformation shows a dialog over the specified window for user information.
|
|
// The title is used for the dialog window and message is the content.
|
|
func ShowInformation(title, message string, parent fyne.Window) {
|
|
NewInformation(title, message, parent).Show()
|
|
}
|
|
|
|
// NewError creates a dialog over the specified window for an application error.
|
|
// The message is extracted from the provided error (should not be nil).
|
|
// After creation you should call Show().
|
|
func NewError(err error, parent fyne.Window) Dialog {
|
|
dialogText := err.Error()
|
|
r, size := utf8.DecodeRuneInString(dialogText)
|
|
if r != utf8.RuneError {
|
|
dialogText = string(unicode.ToUpper(r)) + dialogText[size:]
|
|
}
|
|
return createInformationDialog(lang.L("Error"), dialogText, theme.ErrorIcon(), parent)
|
|
}
|
|
|
|
// ShowError shows a dialog over the specified window for an application error.
|
|
// The message is extracted from the provided error (should not be nil).
|
|
func ShowError(err error, parent fyne.Window) {
|
|
NewError(err, parent).Show()
|
|
}
|