• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

play full screen vedio using Jmf and CDC java

 
cortin flaneir
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to play full screen vedio using jmf. i am using CDC java . please help me.
 
cortin flaneir
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is any one who can help me for above???
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess would be that JMF relies on AWT being present, and I believe JME has a rather slimmed-down version of that. You could start with a simple JSE media player, and then try to get that to compile and run with JME.

BTW, a single question mark at the end of a question is generally sufficient.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18101
51
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:

BTW, a single question mark at the end of a question is generally sufficient.


Are you sure???

Actually, I don't think the mobile device profiles include AWT at all.

I do know that there's a multimedia package and if I'm not mistaken, both video recording and playback are covered by it.

More than that, however and I'd have to RTFM and it's too early in the morning for that.
 
cortin flaneir
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using jmf fedora core six and java CDC . my plyer code is here


import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridBagLayout;
import java.awt.Panel;

import javax.media.ControllerEvent;
import javax.media.EndOfMediaEvent;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.Player;
import javax.media.RealizeCompleteEvent;
import javax.media.Time;

public class VideoXlet implements javax.media.ControllerListener,
javax.microedition.xlet.Xlet {
private javax.microedition.xlet.XletContext context;

private boolean hasBeenStarted;

private Player player;

private Panel panel;

boolean realized = false;

private Panel lContainer;

boolean activeXlet = false;

public VideoXlet() {

}

public void initXlet(javax.microedition.xlet.XletContext context)
throws javax.microedition.xlet.XletStateChangeException {

try {

this.context = context;
lContainer = (Panel) context.getContainer();
lContainer.removeAll();
lContainer.setLayout(new BorderLayout());
hasBeenStarted = false;
panel = new Panel() {
public void paint(Graphics g) {
lContainer.paint(g);
}

public void update(Graphics g) {
paint(g);
}
};
GridBagLayout gridbag = new GridBagLayout();
panel.setLayout(gridbag);
panel.setVisible(true);
context.getContainer().add(panel, BorderLayout.CENTER);
context.getContainer().setVisible(true);
} catch (Exception _ex) {
_ex.printStackTrace();
}

}

public void startXlet()
throws javax.microedition.xlet.XletStateChangeException {
if (hasBeenStarted) {
//
} else {
hasBeenStarted = true;
try {
MediaLocator ml = new MediaLocator("path of movie file");
player = Manager.createPlayer(ml);
player.addControllerListener(this);
blockingRealize();
player.prefetch();
player.start();
} catch (Exception x) {
x.printStackTrace();
}
}
}

public synchronized void blockingRealize() {
player.realize();
while (!realized) {
try {
wait();
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
}
}

public synchronized void controllerUpdate(ControllerEvent ce) {
Component visual;
int videoWidth = 320, videoHeight = 200;

if (ce instanceof EndOfMediaEvent) {
player.setMediaTime(new Time(0.0));
player.start();
}
if (ce instanceof RealizeCompleteEvent) {
realized = true;
notify();
if ((visual = player.getVisualComponent()) != null) {
Dimension size = visual.getPreferredSize();
videoWidth = size.width;
videoHeight = size.height;
panel.add("Center", visual);
}
panel.setSize(videoWidth + 10, videoHeight + 30);
lContainer.validate();
}
}

public void pauseXlet() {

context.resumeRequest();
}

public void destroyXlet(boolean unconditional)
throws javax.microedition.xlet.XletStateChangeException {

if (player != null) {
player.stop();
player.deallocate();
player.close();

}
}
}

when i execute this code then xlet run and vedio play in small window.when i want play it in full screen then performence of vedio goes down.


help me. what can i do.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it's a performance problem, not a question of actually getting it to work in the first place?
 
cortin flaneir
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya.if there is any solution of this problem then give me.what can id with this? thanks in advance.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic