06-05-2009 12:55 PM
Hi all,
I've followed the advice of other forum posts and have managed to get my code to stream video files correctly throught simulator and device (Pearl 8120).
Now, I'd like to actually present a play/pause control to the user, or in some way let the user know how they can pause the video file while they are playing it.
As I understand it, videoControl.initDisplayMode(VideoControl.USE_GUI_
should return a field that contains the GUI controls that can be presented to the user.
However, when I add that field to the screen, using the code below, I get a java.lang.NegativeArraySizeException on the add itself in the invokeLater().
VideoControl control = null;
// create a new VideoControl
if ((control = (VideoControl)tuple.player.getControl("VideoContro
// initialize the video mode using a Field
final Field field = (Field)control.initDisplayMode(VideoControl.USE_GU
control.setVisible(true);
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
UiApplication.getUiApplication().getActiveScreen()
}
});
}
tuple.player.prefetch(); // prefetch
While the NegativeArraySizeException is probably triggered by some other of my code, is my expectation of how to handle this the display of this field correct? E.g. is it correct to capture the field returned by initDisplayMode, then to add it to the screen?
Thanks!
06-05-2009 01:05 PM
Update: the error is happening on the player.start() code a little further down.
So, I don't think it's an error with other parts of my code, but rather an error with how I am handling the Field.
Any thoughts or sample code out there?
Thanks.
06-09-2009 02:49 PM
Please refer to the sample here:
How To - Play video within a BlackBerry smartphone application
Article Number: DB-00641