播放
来源:互联网 发布:linux 优先级 proc 编辑:程序博客网 时间:2024/04/27 14:33
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<VideoView
android:id="@+id/video_view"
android:layout_width="fill_parent"
android:layout_height="300px"
/>
<Button android:id="@+id/cmd_load"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="load"
/>
<Button android:id="@+id/cmd_play"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Play"
/>
<Button android:id="@+id/cmd_pause"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="pause"
/>
</LinearLayout>
package com.eoeandroid.demo.VideoPlayer;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.VideoView;
public class VideoActivity extends Activity {
private static final String TAG = "VideoActivity";
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setTitle("VideoActivity");
Log.v(TAG, "onCreate: ===> ");
setContentView(R.layout.videoplayer);
final VideoView view = (VideoView) findViewById(R.id.video_view);
Button cmdload = (Button) this.findViewById(R.id.cmd_load);
cmdload.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
Log.v(TAG, "setVideoPath: ===> ");
view.setVideoPath("/sdcard/xuwei-liwu.3gp");
}
});
Button cmdplay = (Button) this.findViewById(R.id.cmd_play);
cmdplay.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
Log.v(TAG, "start: ===> ");
view.start();
}
});
Button cmdpause = (Button) this.findViewById(R.id.cmd_pause);
cmdpause.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
Log.v(TAG, "pause: ===> ");
view.pause();
}
});
}
}
- 播放
- 播放
- 播放音效 播放音乐
- 播放音乐 上下播放
- 播放音乐 上下播放
- 播放音乐
- 播放视频文件
- 播放器
- Flash播放
- 播放器
- 视频播放
- 播放音乐
- 播放声音文件
- 播放流媒体
- 播放器
- 音乐播放
- 播放声音
- 播放声音文件
- 数据导入SQL SERVER 2005中,可是提示无法建立数据流连接
- 百度之星2010 复赛第二场 第二题 题目 解题报告
- IT累但是充实
- SQL语句导入导出大全
- java编码转换的详细过程
- 播放
- “联合总裁”得不到充分信任
- Jquery给基本控件的取值、赋值
- 安装Redhat Linux 9.0 后,在命令行下中文显示为乱码的解决方案
- PELCO-D与PELCO-P协议介绍,三维控制键盘码表,安防,摄像机
- 再读:任正非--正确的方向来自于妥协
- 绘制半透明位图
- 判断单链表是否存在环,判断两个链表是否相交问题详解
- ubuntu SSH