Fire onChapter on chapter boundaries; M returns to menu via onMenu

The menu state machine advances via onChapter events when a video crosses a
chapter marker, which we never emitted - so the menu never opened naturally.
Track chapter boundaries from the playlist markers and fire onChapter. Also
change M to invoke the onMenu dispatcher (returns to the menu video) rather
than drawing menu items directly.
This commit is contained in:
2026-09-16 08:41:13 -04:00
parent 0e7accad19
commit 43cc8f420c
2 changed files with 25 additions and 6 deletions
@@ -80,6 +80,8 @@ public class MoviePlayer extends BaseNativeObject {
if (!previousMenuMode && this.menuMode) {
VsmxBaseObject callback = controller.getPropertyValue("onMenu");
System.err.println("[menu] onMenu fires, callback=" + callback
+ " (" + (callback == null ? "null" : callback.getClass().getSimpleName()) + ")");
if (callback instanceof VsmxFunction function) {
interpreter.interpretFunction(function, null, new VsmxBaseObject[0]);
}