Skip to main content

Capture Stop Button

4 replies [Last post]
chrisdvd
Offline
Joined: 2008-08-26
Points: 0

Hi,
I need a little help capturing the Stop button and preventing XletDestroy() from firing automatically. My ultimate goal is to capture the movie time code when the user presses the Stop button and save it to preferences.txt in ADA. I can load and save bookmarks and preferences anywhere and any time during playback but I can't for the life of me, get it to save after Stop has been pressed. It throws SecurityExceptions and won't update the file(s). I've tried grabbing the StopEvent and was successful in re-routing it but it still throws the security exception. Also tried UserEvent Key capturing and that's a no go as well.
Is it possible this can't be done?
Thanks
Chris

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gunnar_adler
Offline
Joined: 2008-04-02
Points: 0

You cannot prevent the termination of the Xlet but there is still
enough time to save preferences when Xlet.destroyXlet() is called. So
put all final actions in your Xlet's destroyXlet method and you should
be fine.

chihiro_saito
Offline
Joined: 2006-11-08
Points: 0

I thought one can capture the stop button as a User Event too, just that it needs to be listed in the bdjo file.

joe_rice
Offline
Joined: 2007-01-04
Points: 0

On Apr 21, 2011, at 8:40 AM, forums@java.net wrote:

> I thought one can capture the stop button as a User Event too, just that it
> needs to be listed in the bdjo file.
>

That's right - if you declare interest in the key in the BDJO and set the title type to interactive, the stop button will only send a key event and not cause a stop UO. Player behavior with interactive titles has some differences to behavior with movie titles. The most significant of which are that there is no concept of chapter numbers, so PSR5 is unreliable, and the player typically won't show any sort of media clock for indicating elapsed/total run time.

We've generally found that I/O operations in destroyXlet() have enough time complete, although some players give a very short window in which to shut down your Xlet before forcibly terminating after detroyXlet() is called (on the order of 1-1.5 seconds).

Joe

chrisdvd
Offline
Joined: 2008-08-26
Points: 0

Thank you for the feedback.

On Scenarist QC, when I try to add my save preferences code to DestroyXlet(), it throws a SecurityException. When I place the code so it writes in between Title jumps (after the player is in a temporary stop mode), no exception is thrown. Is this a Scenarist QC issue? I don't have any other software players or emulators to test so SQC is all I can test on. On the PS3, when the code is in DestroyXlet(), the data looks to be written to AppDataArea - which is a 1MB file. There isn't a physical txt file. Is this normal? When no text file is written, it seems that discs that share OrgID and AppID (but not DiscID) are pulling each other's preferences. When I load Movie A, make a few Bookmarks, eject and put in Movie B, Movie B loads Movie A's Bookmarks (and preferences).

Any Ideas?

Thanks

Chris