Java TV - Problems with XleTView and the background image
Hello!
I磎 a student trying to develop aplications with MHP, i am actually using XleTView 0.3.6.
I磛e traying to show a background image but but nothing appears in the background. I have tryed with Steven Morris's HaviExample and with other codes found in the internet and in this forum.
As i have read, with this version of Xletview its not neccesary to have an I-Frame so i磛e been trying with .jpg, .png, .gif...
actually if i try with an .mpg this appears:
************************************************
[XleTView]-INFO->org.havi.ui.HBackgroundDevice:
At the moment XleTView always return a HStillImageBackgroundConfiguration here
[XleTView]-INFO->org.havi.ui.HBackgroundImage:Display of .mpg is not yet supported.
A workaround for now is to use a .jpg with the same name.
xjava.io.File - Menu1.jpg
************************************************
and i have the Menu1.jpg in the right directory, but nothig appears. I've tryed the 0.3.5 too. Someone can help me?
Thank you!!
[1072 byte] By [
Cavia] at [2007-11-26 23:16:21]

# 1
I've been searching more and i've found that i have to resize the video layer if i want to see the background image. So i磛e tried this code:
HScreen screen = HScreen.getDefaultHScreen();HVideoDevice device;
device = screen.getDefaultHVideoDevice();
//device.reserveDevice(this);
HVideoConfigTemplate template;
template = new HVideoConfigTemplate();
template.setPreference(
template.SCREEN_RECTANGLE, new HScreenRectangle((float)0,(float)0,(float)0,(float)0),
template.PREFERRED);
HVideoConfiguration configuration;
configuration = device.getBestConfiguration(template);
if (configuration != null) {
try {
device.setVideoConfiguration(configuration);
}
catch (Exception e) { }
}
but nothing changes, what i'm doing wrong?
(i don磘 want to watch video, i only want to show a background image)
Cavia at 2007-7-10 14:16:50 >

# 3
Finally i have resolve the problem, i have used this code to resize the video layer (maybe is usefull for someone):
ServiceContext serviceContext = null;Player player = null;
try{
serviceContext = ServiceContextFactory.getInstance().getServiceContext(context);
} catch(ServiceContextException ex){
ex.printStackTrace();
}
/
ServiceContentHandler[] handlers = serviceContext.getServiceContentHandlers();
for(int i = 0; i < handlers.length; i++){
if(handlers<i> instanceof Player)
player = (Player)handlers<i>;
}
AWTVideoSizeControl awtVideoSizeControl;
if (player != null) {
awtVideoSizeControl = (AWTVideoSizeControl) player.getControl("javax.tv.media.AWTVideoSizeControl");
awtVideoSizeControl.setSize(new AWTVideoSize(new Rectangle(0, 0, 720, 576), new Rectangle(0,0,0,0)));
Cavia at 2007-7-10 14:16:50 >
