Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
9353a3c0 by Shaya Potter at 2026-01-16T17:22:07+00:00
Send MediaPresentedEvent after StartEvent in BDHandler

Some BD-J discs rely on receiving org.davic.media.MediaPresentedEvent
to trigger menu visibility. Without this event, the disc's xlet never
makes the menu visible even though the background video is playing.

The DAVIC MediaPresentedEvent indicates "media data begins to be presented"
and should be sent when the player transitions to the Started state and
media is actually being rendered to the screen.

This was discovered with a disc where:
1. Background video playlist started playing correctly
2. StartEvent was sent to the xlet's ControllerListener
3. But the main menu remained invisible
4. Analysis of the decompiled xlet showed it was waiting for
   MediaPresentedEvent to trigger an UpdateStateTask that would
   eventually call setVisible(true) on the menu components

The fix sends MediaPresentedEvent immediately after StartEvent when
the player enters the Started state (from Prefetched). It is NOT sent
in the default case (when start() is called on an already-Started player)
since media is already being presented.

- - - - -


1 changed file:

- src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java


Changes:

=====================================
src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
=====================================
@@ -50,6 +50,8 @@ import javax.media.TimeBase;
 import javax.media.TransitionEvent;
 import javax.media.protocol.DataSource;
 
+import org.davic.media.MediaPresentedEvent;
+
 import javax.tv.locator.Locator;
 import javax.tv.service.selection.ServiceContentHandler;
 
@@ -522,6 +524,8 @@ public abstract class BDHandler implements Player, 
ServiceContentHandler {
             if (error == null) {
                 state = Started;
                 notifyListeners(new StartEvent(this, Prefetched, Started, 
Started, at, getMediaTime()));
+                // Send MediaPresentedEvent after StartEvent - some discs rely 
on this to show menus
+                notifyListeners(new MediaPresentedEvent(this));
             } else {
                 notifyListeners(error);
                 return false;



View it on GitLab: 
https://code.videolan.org/videolan/libbluray/-/commit/9353a3c0a7493457aed7b8d3a083532939e6c17e

-- 
View it on GitLab: 
https://code.videolan.org/videolan/libbluray/-/commit/9353a3c0a7493457aed7b8d3a083532939e6c17e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
libbluray-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libbluray-devel

Reply via email to