This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes play full screen vedio using Jmf and CDC java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "play full screen vedio using Jmf and CDC java" Watch "play full screen vedio using Jmf and CDC java" New topic
Author

play full screen vedio using Jmf and CDC java

cortin flaneir
Greenhorn

Joined: May 26, 2008
Posts: 13
i want to play full screen vedio using jmf. i am using CDC java . please help me.
cortin flaneir
Greenhorn

Joined: May 26, 2008
Posts: 13
there is any one who can help me for above???
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
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.


Ping & DNS - my free Android networking tools app
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16020
    
  20

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
cortin flaneir
Greenhorn

Joined: May 26, 2008
Posts: 13
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
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
So it's a performance problem, not a question of actually getting it to work in the first place?
cortin flaneir
Greenhorn

Joined: May 26, 2008
Posts: 13
ya.if there is any solution of this problem then give me.what can id with this? thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: play full screen vedio using Jmf and CDC java