How to play an audio ( .mp2 or .au ) / video ( mpeg ) file in OCAP thread ?
Hi,
I have 2 questions....
1. Is it possible to play a video file from hard disk in a STB using an OCAP xlet or multi threaded app ?
I guess the answer is NO. But can some1 confirm this for me ?
2. Can someone tell me the steps or point out what am i doing wrong
in trying to play an audio file in my OCAP app ?
From the MHP/Havi tutorials, it seems to be pretty straightforward and simple; but dosen't work for me.
I have tried using .mp2 and .au files and neither works. Also I get no null pointer exceptions when using JMF.
Below is the code I am using to achieve this.....
/***************************************************************************/
javax.media.MediaLocator loc;
javax.media.Player player;
java.io.File file;
file = new File("geese.au");
try {
loc = new javax.media.MediaLocator(
file.toURL().toExternalForm());
// Create the JMF Player for the audio file
player = javax.media.Manager.createPlayer(loc);
// Play it
player.start();
}
catch (Exception e) {
e.printStackTrace();
}
I get the following error when playing file magic.mp2.
Can someone tell what is going wrong here ?
/*********************************************************************/
[Log] ... locator: file://magic.mp2
[Log] getDataSourceList: file
javax.media.NoPlayerException: createPlayer: no data source for file://magic.mp2
at com/motorola/impl/media/OcapManagerPeer.createPlayer(Ljavax/media/MediaLocator;)Ljavax/media/Player; (:0:36)
at javax/media/Manager.createPlayer(Ljavax/media/MediaLocator;)Ljavax/media/Player; (:0:9)
at com/motorola/ivc/IvcUiDisplay.<init>(Lcom/motorola/ivc/IvcQueue;Lcom/motorola/ivc/IvcConfigFileHandler;)V (IvcUiDisplay.java:107:215)
at com/motorola/ivc/IvcUiMgr.<init>(Lcom/motorola/ivc/IvcQueue;Lcom/motorola/ivc/IvcQueue;Lcom/motorola/ivc/IvcConfigFileHandler;Lcom/motorola/ivc/IvcCallLogStack;)V (IvcUiMgr.java:69:14)
at com/motorola/ivc/IvcMgrThread.StartThreads()V (IvcMgrThread.java:78:24)
at com/motorola/ivc/IvcMgrThread.<init>()V (IvcMgrThread.java:56:114)
at com/motorola/ivc/IvcApp.initXlet(Ljavax/tv/xlet/XletContext;)V (IvcApp.java:137:77)
at com/motorola/impl/app/App.doInit()Z (:0:60)
at com/motorola/impl/app/App.startNow()V (:0:37)
at com/motorola/impl/app/AppRequestHandler.run()V (:0:183)
............Playing the audio clip............