當前位置:首頁 » 課程大全 » android視頻播放器課程設計

android視頻播放器課程設計

發布時間: 2021-02-13 16:55:29

A. java課題設計——視頻播放器怎麼製作

import java.awt.*;
import java.awt.event.*;
import java.io.IOException;import javax.swing.*;
import javax.media.*;public class VideoPlayer extends JFrame implements ActionListener,
ControllerListener {
FileDialog fd;
Player player = null;
String name;
String path;
Component comp, vc;
Image image=new ImageIcon("open.GIF").getImage();
MenuBar mb = new MenuBar();
Menu m1 = new Menu("文件");
Menu m2 = new Menu("幫助");
MenuItem mi1 = new MenuItem("打開", new MenuShortcut(KeyEvent.VK_0));
MenuItem mi2 = new MenuItem("關閉");
MenuItem mi3 = new MenuItem("幫助");
JButton open=new JButton(new ImageIcon("open.GIF")); public VideoPlayer() {
super("視屏播放器");
this.setMenuBar(mb);
mb.add(m1);
mb.add(m2);
m1.add(mi1);
mi1.addActionListener(this);
m1.add(mi2);
mi2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
m2.add(mi3);
mi3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null,
"Java視屏播放器\n2010年6月9日第一版\n製作人: 李攀");
}
});
this.setLayout(new BorderLayout());
this.setSize(800, 650);
this.setVisible(true);
this.setBackground(Color.BLACK);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
} public static void main(String[] args) {
new VideoPlayer();
} public void actionPerformed(ActionEvent e) {
if (e.getSource() == mi1) {
open();
}
} public void open() {
fd = new FileDialog(this, "打開媒體文件", FileDialog.LOAD);
fd.setVisible(true);
path = fd.getDirectory();
name = fd.getFile();
if (!path.equals("") && path != null) {
try {
if (player != null)
player.close();
player = Manager.createPlayer(new MediaLocator("file:" + path
+ name));
} catch (Exception ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(null, "獲取播放器失敗!");
}
player.addControllerListener(this);
player.prefetch();
player.start();
}
} public void paint(Graphics g) {
g.setColor(Color.BLACK);
g.fillRect(0, 0, 800, 650);
g.setColor(Color.GREEN);
g.setFont(new Font("宋體",Font.BOLD,30));
g.drawString("歡迎使用",340,150);
g.drawImage(image,330,285,image.getWidth(this),image.getHeight(this),this);
}
public void update(Graphics g){
paint(g);
} public synchronized void controllerUpdate(ControllerEvent e) {
if (e instanceof RealizeCompleteEvent) {
if ((comp = player.getControlPanelComponent()) != null) {
vc = player.getVisualComponent();
if (vc != null)
add(vc);
add("South", comp);
comp.setBackground(Color.green);
}
validate();
}
if (e instanceof ControllerClosedEvent) {
if (vc != null) {
remove(vc);
vc = null;
}
if (comp != null) {
remove(comp);
comp = null;
}
return;
}
if (e instanceof EndOfMediaEvent) {
player.setMediaTime(new Time(0));
player.start();
return;
}
}
}
java的視屏播放要用到JMF(java media framework),你自己到網上去下一個嘛,而且那玩意支持的格式少,mpg,mpeg,sun的官方網站說支持AVI但是我試過了好像不行,至於rmvb那些好像不行,要裝解碼器。JMF在安裝的時候要安裝對哦,路徑要選擇對,不然不行,具體下載地址和安裝方法可以網路一下,到處都是

B. 基於android平台的在線播放器設計與實現 怎麼做

Android中通過VideoView播放視頻的步驟:
1、在界面布局文件中定義VideoView組件,或在程序中創建VideoView組件
2、調用版VideoView的如下兩個方法來載入權指定的視頻,setVidePath(String path):載入path文件代表的視頻;setVideoURI(Uri uri):載入uri所對應的視頻。
3、調用VideoView的start()、stop()、psuse()方法來控制視頻的播放。
VideoView通過與MediaController類結合使用,開發者可以不用自己控制播放與暫停。

C. 基於Android開發一款視頻播放器

自己開發播放器,是不是太難了。你可以使用android自帶的mediaplayer。

D. 求android視頻播放器項目完整源代碼,要可以運行的項目,請高手指點,急!

你有沒有可以運行的完整代碼?我也急需

E. 做android播放器,在視頻每一幀顯示前,插入我的演算法,對幀數據進行處理,需要那些技術經驗,什麼資料。

你要做的是一個完全的獨立於系統的播放器,從讀取數據流,到解釋數據流,這些都將由你的播放器進行。這樣問題就很復雜了,因為視頻的格式有很多種,不同的格式解釋方式又不一樣。

F. android開發了一個視頻播放器,現想在上面彈出一個菜單,不影響背景視頻播放,怎麼實現

使用復制popupwindow即可實現。
參考:http://blog.csdn.net/kkfdsa132/article/details/6403404

G. 我用Android開發一個視頻播放器,可以實現在線播放,怎麼樣才能播放各大網站的視頻

下載個播放的軟體。圖標上面是個F

H. 求安卓課程設計音樂播放器代碼及其講解

你好,朋友。 你在網路裡面搜索「安卓巴士」,裡面有大量Android應用的源碼!不過沒有ppt。 裡面也有你想要的平台音樂播放器源碼。 希望能幫上樓主,望採納!

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919