本文的目的是为读者提供处理不同情况的代码,您可以参考mmapi doc。
player p;tempocontrol tc;try { p = manager.createplayer("http://webserver/tune.mid"); p.realize(); // grab the tempo control. tc = (tempocontrol)p.getcontrol("tempocontrol"); tc.settempo(120000); // 120 beats/min p.start();} catch (ioexception ioe) {} catch (mediaexception me) { }player p;videocontrol vc;try { p = manager.createplayer("http://webserver/movie.mpg"); p.realize(); // grab the video control and set it to the current display. vc = (videocontrol)p.getcontrol("videocontrol"); if (vc != null) { form form = new form("video"); form.append((item)vc.initdisplaymode(vc.use_gui_primitive, null)); display.getdisplay(midlet).setcurrent(form); } p.start();} catch (ioexception ioe) {} catch (mediaexception me) { }recordstore rs;int recordid; : // code to set up the record store.try { inputstream is = new bytearrayinputstream(rs.getrecord(recordid)); player p = manager.createplayer(is, "audio/x-wav"); p.start();} catch (ioexception ioe) {} catch (mediaexception me) { }[1] [2] 下一页
- Copyright © 2001- 2010 丰搜网 All Rights Reserved
- ICP备案编号:粤ICP备06052964号
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器