Release v0.9.11: Media playback behavior clarifications

This release clarifies the media playback behavior and fixes an incorrect
"smart grace period" implementation that violated the core principle.

Core Principle:
- Media playback TRUMPS everything (rotation and inactivity prompts)
- Media plays uninterrupted until: ends naturally, user pauses, session
  lockout, or display schedule
- After media stops: 30-second grace period ALWAYS applies (no exceptions)
- After grace period: Normal inactivity and rotation rules resume

Changes:
- Restored simple grace period logic (always 30 seconds after media stops)
- Removed incorrect "smart" grace period that could skip the delay
- Added clarifying comments about media blocking behavior
- Documented that inactivity timeout is user-configurable (default 2 minutes)

The grace period ensures smooth transitions when media ends naturally,
preventing jarring interruptions with popups or rotation changes.
This commit is contained in:
Claude
2025-11-17 17:02:00 +00:00
parent 0b9c2dfba2
commit 815bfd6830
@@ -1,9 +1,20 @@
#!/bin/bash
################################################################################
### Ubuntu Based Kiosk (UBK) v0.9.10 ###
### Ubuntu Based Kiosk (UBK) v0.9.11 ###
################################################################################
#
# RELEASE v0.9.10 - Rotation Logic Fixes
# RELEASE v0.9.11 - Media Playback Clarifications
#
# What's in v0.9.11:
# - Clarified media playback behavior in comments
# * While media plays: NO rotation, NO prompts, NOTHING interrupts
# * Media only pauses for: media ends, user pauses, session lockout, display schedule
# * After media stops: 30-second grace period ALWAYS applies
# * After grace period: Normal inactivity and rotation rules resume
# - Inactivity timeout is user-configurable
# * Default: 2 minutes (120 seconds)
# * Can be changed via Sites menu when setting home site
# * Value stored in seconds in config, converted to milliseconds in app
#
# What's in v0.9.10:
# - Fixed rotation logic to properly handle user interaction
@@ -3865,16 +3876,19 @@ function startMasterTimer(){
}
// 3. MEDIA BLOCKING
// While media plays: NO rotation, NO prompts, NOTHING interrupts playback
if(mediaIsPlaying){
return;
}
// 4. GRACE PERIOD
// After media stops: Always wait 30 seconds before rotation or prompts
// This prevents interruptions when video/audio ends naturally
const timeSinceMediaStopped=now-lastMediaStateChange;
if(timeSinceMediaStopped<MEDIA_GRACE_PERIOD){
return;
}
// 5. USER ACTIVITY CHECK
const timeSinceInteraction=now-lastUserInteraction;
userRecentlyActive=timeSinceInteraction<USER_ACTIVITY_PAUSE;