NWMDemo.errorDialog(e.toString());
}
}
}));
final Image pauseImage =
ImageFactory.createImage(Bitmap
.getBitmapResource("pause.png"));
pauseButton.setImage(pauseImage);
componentCanvas.add(pauseButton, 0, VIDEO_HEIGHT - 15);
// Button to start/re-start the video
final ButtonField playButton =
new ButtonField("Play", ButtonField.CONSUME_CLICK
| ButtonField.NEVER_DIRTY);
playButton.setCommand(new Command(new CommandHandler() {
public void execute(final ReadOnlyCommandMetadata metadata,
final Object object) {
// Start the video
try {
_player.start();
} catch (final Exception e) {
NWMDemo.errorDialog(e.toString());
}
}
}));
final Image playImage =
ImageFactory.createImage(Bitmap
.getBitmapResource("play.png"));
playButton.setImage(playImage);
componentCanvas
.add(playButton, VIDEO_WIDTH - 80, VIDEO_HEIGHT - 15);