Skip to main content

Lwiut 1.5 Black Area shown after playing video in VideoComponent, How to remove it?

9 replies [Last post]
abuhmead1987
Offline
Joined: 2010-04-21
Points: 0

Dear guys,

I created a form to play video and I added to it a VideoComponent, after the media finished another form should be displayed, But the another form displayed and i see just the title and the menu and the center of the form covered by black area which is the area of the VideoComponent from the VideoPlayer form.

I tested it on many devices, but the same thing happend, Look at the video player Form src code

import com.sun.lwuit.Dialog;
import com.sun.lwuit.Form;
import com.sun.lwuit.VideoComponent;
import com.sun.lwuit.layouts.BorderLayout;
import java.io.IOException;
import javax.microedition.media.Player;
import javax.microedition.media.PlayerListener;
/**
* @author Mohammad
*/
public class VideoPlayer extends Form implements PlayerListener
{
private Player player1;
private VideoComponent videoComponent;
public VideoPlayer(String videoResURLWithExtension, String videoType) {
setLayout(new BorderLayout());
try {
videoComponent=VideoComponent.createVideoPeer(getClass().
getResourceAsStream("/"+videoResURLWithExtension),"Video/"+videoType);
videoComponent.setFullScreen(true);
addComponent(BorderLayout.CENTER, videoComponent);
player1=((Player)videoComponent.getClientProperty("Player"));
player1.addPlayerListener((PlayerListener)this);
} catch (IOException ex) {
Dialog.show("Error:", "Error in creating video player : "+ex.getMessage(), "OK", null);
}
}
public void playerUpdate(Player player, String event, Object eventData) {
try {
if (event.equals(PlayerListener.END_OF_MEDIA)) {
videoComponent.stop();
removeAll();
MidletMain.mainForm.show();
System.gc();
}
} catch (Exception e) {
}
}
public void show() {
super.show();
videoComponent.start();
}
}
How to solve this problem, or it is VideoComponent Bug?
Thanks alot,
Mohammad Abu Hmead.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07
Points: 0

Try setUIID("Label") on the VideoComponent and see if it helps.

abuhmead1987
Offline
Joined: 2010-04-21
Points: 0

The problem is still,

vprise
Offline
Joined: 2003-11-07
Points: 0

I'll need to see this more visually. Can you file a bug with code samples and a screenshot to the issue tracker?

Thansk.

abuhmead1987
Offline
Joined: 2010-04-21
Points: 0

vprise wrote:

I'll need to see this more visually. Can you file a bug with code samples and a screenshot to the issue tracker?

Thansk.

Look @ the attached figure,

vprise
Offline
Joined: 2003-11-07
Points: 0

I asked Chen and he pointed out that you probably don't exit full screen mode.

abuhmead1987
Offline
Joined: 2010-04-21
Points: 0

So, How do I exit the FullScreen?
I tried to use setFullScreen(false);
public void playerUpdate(Player player, String event, Object eventData) {
try {
if (event.equals(PlayerListener.END_OF_MEDIA)) {
videoComponent.stop();
videoComponent.setFullScreen(false);
videoComponent=null;
removeAll();
UIManager.getInstance().getLookAndFeel().uninstall();
MidletMain.mainForm.show();
System.gc();
}
} catch (Exception e) {
}

vprise
Offline
Joined: 2003-11-07
Points: 0

This might be an issue in full screen mode. Just to be sure it only happens when you activate the full screen mode right?

Please file an issue on it and assign it to chenf.

Thanks.

abuhmead1987
Offline
Joined: 2010-04-21
Points: 0

It is in both states,

I don't know what did you mean "Please file an issue on it and assign it to chenf."??

vprise
Offline
Joined: 2003-11-07
Points: 0

Go to lwuit.java.net and create a bug report, assign it to chenf from the combo box.