I am tryin to create a media player that uses the MMAPI to open up a media file stored on the phone.
i have tried using the MIDP: Mobile Media API develpoers guide with no success. When i load a stream nothing happens
i have also tried with :Code:inputStream is = getClass().getResourceAsStream(address); Player player = Manager.createPlayer(is,"video/3gpp"); player.addPlayerListener(this); player.realize(); player.prefetch(); VideoControl vc = (VideoControl)player.getControl("VideoControl"); if (videoControl == null) { midlet.alertError("VideoControl not supported"); } else { vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this); videoControl.setVisible(true); player.start(); }
and have also triedCode:try { //inputStream is = getClass().getResourceAsStream(address); Player player = Manager.createPlayer(address); player.addPlayerListener(this); player.realize(); player.prefetch(); VideoControl vc = (VideoControl)player.getControl("VideoControl"); if (videoControl == null) { midlet.alertError("VideoControl not supported"); } else { vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this); videoControl.setVisible(true); player.start(); }
this one the sound will play but no videoCode:try { //inputStream is = getClass().getResourceAsStream(address); Player player = Manager.createPlayer(address); player.addPlayerListener(this); player.realize(); player.prefetch(); player.start(); VideoControl vc = (VideoControl)player.getControl("VideoControl"); if (videoControl == null) { midlet.alertError("VideoControl not supported"); } else { vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this); videoControl.setVisible(true); }
the other two examples just the alertError is created. Any help would be greatly appreciated. The try statements are caught but i just left that part of the code out to save room.
Address is an app property that points on an address on the phone in this case file:///C:/Data/Vidoes/t2.3gp
i have tried more than one file but none see to work.

Reply With Quote


