Add playback session logging for troubleshooting

This commit is contained in:
Stu 2025-12-09 18:53:30 -05:00
parent ab9f19095d
commit ee08618142

View File

@ -3520,7 +3520,12 @@ func buildVideoPane(state *appState, min fyne.Size, src *videoSource, onCover fu
var updatingVolume bool
ensureSession := func() bool {
if state.playSess == nil {
fmt.Printf("🎥 Creating play session for %s\n", src.Path)
state.playSess = newPlaySession(src.Path, src.Width, src.Height, src.FrameRate, int(targetWidth-28), int(targetHeight-40), updateProgress, img)
if state.playSess == nil {
fmt.Printf("❌ ERROR: Failed to create play session\n")
return false
}
state.playSess.SetVolume(state.playerVolume)
state.playerPaused = true
}
@ -3587,15 +3592,18 @@ func buildVideoPane(state *appState, min fyne.Size, src *videoSource, onCover fu
updateVolIcon()
volSlider.Refresh()
playBtn := utils.MakeIconButton("▶/⏸", "Play/Pause", func() {
fmt.Printf("▶ Play/Pause pressed\n")
if !ensureSession() {
return
}
if state.playerPaused {
state.playSess.Play()
state.playerPaused = false
fmt.Printf("▶ Playback started\n")
} else {
state.playSess.Pause()
state.playerPaused = true
fmt.Printf("⏸ Playback paused\n")
}
})
fullBtn := utils.MakeIconButton("⛶", "Toggle fullscreen", func() {