資源簡介
在原先的基礎上手寫了一些調用方法,能夠將WMP嵌入至Java程序界面,調用控件屬性

代碼片段和文件信息
package?player;
import?org.eclipse.swt.SWT;
import?org.eclipse.swt.layout.FillLayout;
import?org.eclipse.swt.widgets.Display;
import?org.eclipse.swt.widgets.Shell;
public?class?Player
{
????protected?Shell?shell;
????/**
?????*?Launch?the?application
?????*?@param?args
?????*/
????public?static?void?main(String[]?args)
????{
????????try
????????{
????????????Player?window?=?new?Player();
????????????window.open();
????????}
????????catch?(Exception?e)
????????{
????????????e.printStackTrace();
????????}
????}
????/**
?????*?Open?the?window
?????*/
????public?void?open()
????{
????????final?Display?display?=?Display.getDefault();
????????createContents();
????????shell.open();
????????shell.layout();
????????while?(!shell.isDisposed())
????????{
????????????if?(!display.readAndDispatch())
????????????????display.sleep();
????????}
????}
????/**
?????*?Create?contents?of?the?window
?????*/
????protected?void?createContents()
????{
????????shell?=?new?Shell();
????????shell.setLayout(new?FillLayout());
????????shell.setSize(500?375);
????????shell.setText(“SWT?Application“);
????????final?WMP?composite?=?new?WMP(shell?SWT.NONE);
????????composite.play(“rtsp://10.1.71.158/vod/11.rmvb“); //播放地址,可為流媒體也可以為本地媒體資源
????????
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1337??2014-08-21?10:53??pla
?????文件??????10293??2014-08-21?10:47??pla
?????目錄??????????0??2014-08-21?10:54??pla
-----------?---------??----------?-----??----
????????????????11630????????????????????3
- 上一篇:百度AI人臉比對java
- 下一篇:達內 java 全套視頻百度云分享
評論
共有 條評論