You Are Here:

Community: Wiki

This page was last modified on 11 June 2009, at 10:03.

KIJ001367 - MMAPI player crashes in eSWT MIDlet

From Forum Nokia Wiki



ID KIJ001367 Creation date June 11, 2009
Platform S60 3rd Edition, FP2, S60 5th Edition Devices Nokia N96, Nokia 5800 XpressMusic
Category Java ME Subcategory eSWT API


Keywords (APIs, classes, methods, functions): javax.microedition.media, org.eclipse.swt

Description

An MMAPI player crashes when playing is started from an eSWT MIDlet.

How to reproduce

1. Implement a test MIDlet using the following source code:

import java.io.IOException;
import java.io.InputStream;
import javax.microedition.media.Manager;
import javax.microedition.media.MediaException;
import javax.microedition.media.Player;
import javax.microedition.media.control.VideoControl;
import javax.microedition.midlet.MIDlet;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
 
public class MMAPIExample extends MIDlet implements Runnable {
 
 
Display display;
VideoControl vc;
Thread UIThread;
Shell shell;
 
 
public void startApp() {
 
// Creating an eSWT UI thread.
if(UIThread == null) {
UIThread = new Thread(this);
UIThread.start();
}
}
 
public void pauseApp() {
 
}
 
public void destroyApp(boolean unconditional) {
// Dispose the remaining resources.
display.dispose();
}
 
// The eSWT UI Thread
public void run() {
// Create the Display.
display = new Display();
 
shell = new Shell(display);
shell.open();
 
Player player= null ;
try {
 
InputStream is = getClass().getResourceAsStream("video.format");
player = Manager.createPlayer(is, null);
player.prefetch();
 
vc = (VideoControl)player.getControl("VideoControl");
Control vControl = (org.eclipse.swt.widgets.Control)
vc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "org.eclipse.swt.widgets.Control");
vControl.setParent(shell);
vc.setDisplayFullScreen(true);
player.start();
 
} catch (IOException e) {
 
} catch (MediaException e) {
 
}
 
 
// Execute the eSWT event loop.
while(!shell.isDisposed()) {
if(!display.readAndDispatch()) {
display.sleep();
}
}
if (player != null ){
player.deallocate();
player.close();
player = null;
}
 
// Clean up and destroy the MIDlet
destroyApp(true);
notifyDestroyed();
}
 
public void widgetDefaultSelected(SelectionEvent e) {
}
}

2. Launch the test MIDlet. For the affected devices, no video will be played but Error java.lang.Error SymbianOS Error = -1 will be given instead.

Solution

This issue is expected to be fixed in future software versions for the affected devices, starting from S60 5th Edition.

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fKIJ001203E5fE2dE5fNewE5flineE5fcannotE5fbeE5finsertedE5fwithE5fE2527E255CnE2527E5fcharE5finE5fAlertE5fusingE5fJavaE5fME45E5finE5fS60X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZKnowledgeBaseContentQ qdcZtypeQUqfntypeZKnownIssueQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZKnowledgeBaseContentQ qfnZtypeQUqfntypeZKnownIssueQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZKnowledgeBaseContentQ qrdfZtypeQUqfntypeZKnownIssueQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ