Vitamio视频播放
activity代码
package com.hck.player.ui; import io.vov.utils.StringUtils;
import io.vov.vitamio.LibsChecker;
import io.vov.vitamio.MediaPlayer;
import io.vov.vitamio.MediaPlayer.OnBufferingUpdateListener;
import io.vov.vitamio.MediaPlayer.OnCompletionListener;
import io.vov.vitamio.MediaPlayer.OnErrorListener;
import io.vov.vitamio.MediaPlayer.OnInfoListener;
import io.vov.vitamio.MediaPlayer.OnPreparedListener;
import io.vov.vitamio.MediaPlayer.OnSeekCompleteListener;
import io.vov.vitamio.MediaPlayer.OnVideoSizeChangedListener;
import io.vov.vitamio.widget.VideoView; import java.sql.Timestamp;
import java.util.ArrayList; import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Color;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.Display;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView; import com.hck.myplayer.R;
import com.zdp.aseo.content.AseoZdpAseo; public class PlayActivity extends BaseActivity implements OnClickListener,
OnBufferingUpdateListener, OnCompletionListener, OnPreparedListener,
OnVideoSizeChangedListener, SurfaceHolder.Callback, OnErrorListener,
OnInfoListener, OnSeekCompleteListener {
private String path;
private ImageView imageView;
private TextView nametTextView;
private TextView timeTextView;
private Button chiceButton;
private Button fontbButton, playbButton, nextButton;
private VideoView videoView;
private FrameLayout fLayout;
private LinearLayout layout;
private boolean isPlay;
private SeekBar seekBar;
private upDateSeekBar update;
private boolean isLock;
private String timeString;
private TextView play_tiem, endTime;
private String name;
private ImageView mOperationBg;
private ImageView mOperationPercent;
private View mVolumeBrightnessLayout;
private AudioManager mAudioManager;
/** 最大声音 */
private int mMaxVolume;
/** 当前声音 */
private int mVolume = -;
/** 当前亮度 */
private float mBrightness = -1f;
private GestureDetector mGestureDetector;
private View bar;
private TextView textViewBF;
private TextView sudu;
private TextView sudu2;
private PopupWindow pWindow;
private Button qingxiButton, liuchangButton, gaoqingButton; private boolean isFinish;
private long pauseSize;
private long size;
private ArrayList<String> urls;
private static int flag; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 检测Vitamio是否解压解码包
if (!LibsChecker.checkVitamioLibs(this))
return;
// 去除标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
// 设置为全屏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// 定义布局
setContentView(R.layout.play);
// 初始化布局
initView();
// 获得数据
getInitDate();
// 设置数据
setInitDate();
nextButton.setEnabled(false);
fontbButton.setEnabled(false);
play();
AseoZdpAseo.initType(this, AseoZdpAseo.INSERT_TYPE); } private void getInitDate() {
// path = getIntent().getStringExtra("path");
// 获取视频的名称
name = getIntent().getStringExtra("name");
// 获取视频的url
urls = getIntent().getStringArrayListExtra("url"); } private void setInitDate() {
// 设置视频的名称,并显示在屏幕上
nametTextView.setText("视频名字:" + name);
} private void initView() {
// 地址集合
urls = new ArrayList<String>();
// 视频播放进度条
seekBar = (SeekBar) findViewById(R.id.seekBar);
// 视频信息 ,设置为不可见
fLayout = (FrameLayout) findViewById(R.id.title_fl);
fLayout.setVisibility(View.GONE);
// 视频屏幕下方的控制菜单,设置为不可见
layout = (LinearLayout) findViewById(R.id.buttom_lin);
layout.setVisibility(View.GONE);
// 视频播放框
videoView = (VideoView) findViewById(R.id.surface_view);
// 屏幕是否解锁,并设置不可见,实现监听
imageView = (ImageView) findViewById(R.id.image_lock);
imageView.setOnClickListener(this);
imageView.setVisibility(View.GONE);
// 视频下载的速度kb/s
sudu = (TextView) findViewById(R.id.sudu); sudu2 = (TextView) findViewById(R.id.sudu2);
// 视频缓冲进度条
bar = findViewById(R.id.pb);
// 视频缓冲的进度,百分比
textViewBF = (TextView) bar.findViewById(R.id.buff);
// 视频已经播放的时间
play_tiem = (TextView) findViewById(R.id.play_time);
// 视频播放总时间
endTime = (TextView) findViewById(R.id.play_end_time);
// 视频名称,并设置监听
nametTextView = (TextView) findViewById(R.id.movie_name);
nametTextView.setOnClickListener(this);
// 视频的时间
timeTextView = (TextView) findViewById(R.id.movie_time);
// 得到当前时间(通过时间戳的装换函数Timestamp)
timeString = (new Timestamp(System.currentTimeMillis())).toString()
.substring(, );
timeTextView.setText(timeString);
// 视频质量设定按钮,并设置监听按钮
chiceButton = (Button) findViewById(R.id.zhiliang);
chiceButton.setOnClickListener(this);
// 快退按钮 ,并设置监听
fontbButton = (Button) findViewById(R.id.font);
fontbButton.setOnClickListener(this);
// 播放按钮,并设置监听
playbButton = (Button) findViewById(R.id.play);
playbButton.setOnClickListener(this);
// 快进按钮并设置监听
nextButton = (Button) findViewById(R.id.next);
nextButton.setOnClickListener(this);
// 控制喇叭音量
mVolumeBrightnessLayout = findViewById(R.id.operation_volume_brightness);
// 喇叭图片
mOperationBg = (ImageView) findViewById(R.id.operation_bg);
// 音量控制的进度条
mOperationPercent = (ImageView) findViewById(R.id.operation_percent);
// 手势操作类,并设置手势监听
mGestureDetector = new GestureDetector(this, new MyGestureListener());
// 获取系统服务
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
// 获取系统的最大音量
mMaxVolume = mAudioManager
.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
// 控制屏幕翻转
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
// 更新seekbar,即视频播放进度监听
setListener();
// 更新seekbar时,根据视频播放进度跟新时间等数据
update = new upDateSeekBar();
new Thread(update).start();
} private class MyGestureListener extends SimpleOnGestureListener {
@Override
// 当用户在屏幕上"滚动"时触发该方法
public boolean onScroll(MotionEvent e1, MotionEvent e2,
float distanceX, float distanceY) {
// 得到x,y坐标当前值,相对于当前view
float mOldX = e1.getX(), mOldY = e1.getY();
// getRawY()是表示相对于屏幕左上角的y坐标值
int y = (int) e2.getRawY();
// 获得屏幕的宽高
Display disp = getWindowManager().getDefaultDisplay();
int windowWidth = disp.getWidth();
int windowHeight = disp.getHeight();
// 右边滑动
if (mOldX > windowWidth * 4.0 / )
onVolumeSlide((mOldY - y) / windowHeight);
// 左边滑动
else if (mOldX < windowWidth / 5.0)
onBrightnessSlide((mOldY - y) / windowHeight);
return super.onScroll(e1, e2, distanceX, distanceY);
}
} /**
* 滑动改变声音大小
*
* @param percent
*/
private void onVolumeSlide(float percent) {
if (mVolume == -) {
mVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
if (mVolume < )
mVolume = ; // 显示声音的大小
mOperationBg.setImageResource(R.drawable.video_volumn_bg);
mVolumeBrightnessLayout.setVisibility(View.VISIBLE);
} int index = (int) (percent * mMaxVolume) + mVolume;
if (index > mMaxVolume)
index = mMaxVolume;
else if (index < )
index = ;
// 变更声音
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, index, );
// 变更进度条
ViewGroup.LayoutParams lp = mOperationPercent.getLayoutParams();
lp.width = findViewById(R.id.operation_full).getLayoutParams().width
* index / mMaxVolume;
mOperationPercent.setLayoutParams(lp);
} /**
* 滑动改变亮度
*
* @param percent
*/
private void onBrightnessSlide(float percent) {
if (mBrightness < ) {
mBrightness = getWindow().getAttributes().screenBrightness;
if (mBrightness <= 0.00f)
mBrightness = 0.50f;
if (mBrightness < 0.01f)
mBrightness = 0.01f; // 显示
mOperationBg.setImageResource(R.drawable.video_brightness_bg);
mVolumeBrightnessLayout.setVisibility(View.VISIBLE);
} WindowManager.LayoutParams lpa = getWindow().getAttributes();
lpa.screenBrightness = mBrightness + percent;
if (lpa.screenBrightness > 1.0f)
lpa.screenBrightness = 1.0f;
else if (lpa.screenBrightness < 0.01f)
lpa.screenBrightness = 0.01f;
getWindow().setAttributes(lpa);
// 变更进度条
ViewGroup.LayoutParams lp = mOperationPercent.getLayoutParams();
lp.width = (int) (findViewById(R.id.operation_full).getLayoutParams().width * lpa.screenBrightness);
mOperationPercent.setLayoutParams(lp);
}
//播放视频
private void play() {
Log.i("hck", "play flag1: " + urls.get(flag));
isPlay = true;
try {
videoView.setVideoURI(Uri.parse(urls.get(flag)));
videoView.setOnCompletionListener(this);
videoView.setOnBufferingUpdateListener(this);
videoView.setOnErrorListener(this);
videoView.setOnInfoListener(this);
videoView.setOnPreparedListener(this); } catch (Exception e) {
Log.i("hck", "PlayActivity " + e.toString());
}
} class upDateSeekBar implements Runnable { @Override
public void run() {
if (!isFinish) {
mHandler.sendMessage(Message.obtain());
mHandler.postDelayed(update, );
} }
}
//通过用户指定的播放进度更新时间等信息
@SuppressLint("HandlerLeak")
Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
if (videoView == null) {
return;
}
timeString = (new Timestamp(System.currentTimeMillis())).toString()
.substring(, );
timeTextView.setText(timeString);
play_tiem.setText(StringUtils.generateTime(videoView
.getCurrentPosition()));
if (videoView != null) {
seekBar(videoView.getCurrentPosition());
} };
}; private void seekBar(long size) {
if (videoView.isPlaying()) {
long mMax = videoView.getDuration();
int sMax = seekBar.getMax();
seekBar.setProgress((int) (size * sMax / mMax)); }
} private void setListener() {
seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override
public void onStopTrackingTouch(SeekBar seekBar) { int value = (int) (seekBar.getProgress()
* videoView.getDuration() / seekBar.getMax());
videoView.seekTo(value);
videoView.start();
isPlay = true;
} @Override
public void onStartTrackingTouch(SeekBar seekBar) {
isPlay = false;
videoView.pause();
} @Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) { }
}); } @Override
public boolean onTouchEvent(MotionEvent event) {
if (mGestureDetector.onTouchEvent(event))
return true;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
if (!isLock) {
fLayout.setVisibility(View.VISIBLE);
layout.setVisibility(View.VISIBLE); }
imageView.setVisibility(View.VISIBLE);
break;
case MotionEvent.ACTION_UP:
// 处理手势结束
endGesture();
break; default:
break;
}
return super.onTouchEvent(event);
}
/** 手势结束 */
private void endGesture() {
mVolume = -;
mBrightness = -1f;
// 隐藏
disHandler.removeMessages();
disHandler.sendEmptyMessageDelayed(, );
disHandler.removeMessages();
disHandler.sendEmptyMessageDelayed(, );
} private Handler disHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (msg.what == ) {
mVolumeBrightnessLayout.setVisibility(View.GONE);
} else {
fLayout.setVisibility(View.GONE);
layout.setVisibility(View.GONE);
imageView.setVisibility(View.GONE);
if (pWindow != null && pWindow.isShowing()) {
pWindow.dismiss();
}
} }
}; @SuppressLint("HandlerLeak")
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.play:
if (isPlay) {
videoView.pause();
playbButton
.setBackgroundResource(R.drawable.player_play_highlight);
isPlay = false;
seekBar.setEnabled(false);
} else {
playbButton
.setBackgroundResource(R.drawable.player_pause_highlight);
videoView.start();
isPlay = true;
seekBar.setEnabled(true);
}
break;
case R.id.image_lock:
if (isLock) {
isLock = false;
imageView.setBackgroundResource(R.drawable.lock_off);
} else {
isLock = true;
imageView.setBackgroundResource(R.drawable.lock_on);
}
break;
case R.id.next:
videoView.pause();
if (videoView != null) {
size = videoView.getCurrentPosition() + videoView.getDuration()
/ ;
videoView.seekTo(size);
videoView.start();
}
break;
case R.id.font:
videoView.pause();
if (videoView != null) {
size = videoView.getCurrentPosition() - videoView.getDuration()
/ ;
videoView.seekTo(size);
videoView.start();
}
break;
case R.id.zhiliang:
Log.i("hck", "zhiliang");
showPop(v);
break; }
} @Override
public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) { } @Override
public void surfaceCreated(SurfaceHolder arg0) {
Log.i("hck", "surfaceCreated");
} @Override
public void surfaceDestroyed(SurfaceHolder arg0) { } @Override
public void onVideoSizeChanged(MediaPlayer arg0, int arg1, int arg2) {
} @Override
public void onPrepared(MediaPlayer arg0) {
nextButton.setEnabled(true);
fontbButton.setEnabled(true);
bar.setVisibility(View.GONE);
if (urls.get(flag).startsWith("http")) {
videoView.setBufferSize( * );
} else {
videoView.setBufferSize();
}
endTime.setText(StringUtils.generateTime(videoView.getDuration()));
bar.setVisibility(View.GONE);
if (pauseSize > ) {
videoView.seekTo(pauseSize);
}
pauseSize = ;
} @Override
public void onCompletion(MediaPlayer arg0) {
videoView.stopPlayback();
} @Override
public void onBufferingUpdate(MediaPlayer arg0, int arg1) {
textViewBF.setTextColor(Color.CYAN);
textViewBF.setText(videoView.getBufferPercentage() + "%"); } @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
videoView.setVideoLayout(, );
} @Override
public boolean onError(MediaPlayer arg0, int arg1, int arg2) {
Log.i("hck", "error :" + arg1 + arg2);
return false;
} @Override
public boolean onInfo(MediaPlayer arg0, int arg1, int arg2) {
switch (arg1) {
case MediaPlayer.MEDIA_INFO_BUFFERING_START:
if (isPlay) {
bar.setVisibility(View.VISIBLE);
videoView.pause();
isPlay = false; }
break;
case MediaPlayer.MEDIA_INFO_BUFFERING_END:
if (!isPlay) {
bar.setVisibility(View.GONE);
videoView.start();
isPlay = true; }
break;
case MediaPlayer.MEDIA_INFO_DOWNLOAD_RATE_CHANGED:
sudu.setTextColor(Color.CYAN);
sudu.setText(arg2 + "kb/s");
sudu2.setText(arg2 + "kb/s");
break;
}
return true;
} @Override
protected void onPause() {
super.onPause();
videoView.pause(); } @Override
protected void onResume() {
super.onResume();
if (isPlay) {
videoView.start();
}
} @Override
protected void onDestroy() {
super.onDestroy();
if (videoView != null) {
videoView.stopPlayback();
videoView = null;
}
if (pWindow != null && pWindow.isShowing()) {
pWindow.dismiss();
}
isPlay = false;
isFinish = true;
System.gc(); } @Override
public void onSeekComplete(MediaPlayer arg0) { } private void showPop(View view2) { // View view = LayoutInflater.from(this).inflate(R.layout.pop, null);
// qingxiButton = (Button) view.findViewById(R.id.qingxi);
// gaoqingButton = (Button) view.findViewById(R.id.gaoqing);
// liuchangButton = (Button) view.findViewById(R.id.liuchang);
// pWindow = new PopupWindow(view, LayoutParams.WRAP_CONTENT,
// LayoutParams.WRAP_CONTENT);
// pWindow.setOutsideTouchable(true);
// pWindow.showAtLocation(view2, Gravity.LEFT, Gravity.LEFT, 1);
// setListener2(); } private void setListener2() {
qingxiButton.setOnClickListener(this);
gaoqingButton.setOnClickListener(this);
liuchangButton.setOnClickListener(this);
} }
缺少 :/** 当前缩放模式 */
private int mLayout = VideoView.VIDEO_LAYOUT_ZOOM;、
参考:http://www.cnblogs.com/over140/archive/2012/05/22/2473019.html
xml代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000" > <io.vov.vitamio.widget.VideoView
android:id="@+id/surface_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" /> <FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" > <!-- 视频信息 --> <FrameLayout
android:id="@+id/title_fl"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@drawable/test_widget_bg"
android:visibility="gone" > <TextView
android:id="@+id/movie_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#ffffff"
android:textSize="16sp" /> <TextView
android:id="@+id/movie_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_marginRight="10dp"
android:text="11:34"
android:textColor="#ffffff" />
</FrameLayout>
<!-- 屏幕是否解锁 --> <ImageView
android:id="@+id/image_lock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:src="@drawable/lock_off"
android:visibility="gone" /> <LinearLayout
android:id="@+id/buttom_lin"
android:layout_width="fill_parent"
android:layout_height="70dp"
android:layout_gravity="bottom"
android:background="@drawable/test_widget_bg"
android:gravity="center_vertical"
android:orientation="vertical" > <RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" > <!-- 视频已经播放的时间 --> <TextView
android:id="@+id/play_time"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:text="20:12:33"
android:textColor="#ffffff"
android:textSize="12sp" />
<!-- 视频播放进度条 --> <SeekBar
android:id="@+id/seekBar"
style="@style/player_progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_toLeftOf="@+id/play_end_time"
android:layout_toRightOf="@+id/play_time" /> <!-- 视频播放总时间 --> <TextView
android:id="@+id/play_end_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="3dp"
android:text="20:12:33"
android:textColor="#ffffff"
android:textSize="12sp" />
</RelativeLayout> <RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" > <!-- 视频质量设定按钮 --> <Button
android:id="@+id/zhiliang"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:background="@drawable/player_quality_current_background"
android:onClick="showP"
android:text="质量"
android:textColor="#ffffff"
android:textSize="12sp" /> <FrameLayout
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true" > <!-- 快退按钮 --> <Button
android:id="@+id/font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="@drawable/player_prev_highlight" />
<!-- 播放,停止按钮 --> <Button
android:id="@+id/play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/player_pause_highlight" />
<!-- 快进按钮 --> <Button
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@drawable/test_player_next_highlight" />
</FrameLayout> <TextView
android:id="@+id/sudu2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:layout_marginRight="2dp"
android:gravity="center_vertical"
android:text="显示"
android:textColor="#ffffff"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout>
</FrameLayout>
<!-- 控制喇叭音量 --> <FrameLayout
android:id="@+id/operation_volume_brightness"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#00000000"
android:orientation="horizontal"
android:padding="0dip"
android:visibility="invisible" > <ImageView
android:id="@+id/operation_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/video_volumn_bg" /> <FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:paddingBottom="25dip" > <ImageView
android:id="@+id/operation_full"
android:layout_width="94dip"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:src="@drawable/video_num_bg" /> <ImageView
android:id="@+id/operation_percent"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:scaleType="matrix"
android:src="@drawable/video_num_front" />
</FrameLayout>
</FrameLayout>
<!-- 视频缓冲进度条 --> <LinearLayout
android:id="@+id/pb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="horizontal" >
<TextView
android:id="@+id/sudu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="5dp"
android:textColor="#ffffff"
android:textSize="18sp" /> <TextView
android:id="@+id/buff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="0%"
android:textSize="18sp" /> <ProgressBar
style="@android:style/Widget.ProgressBar.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</LinearLayout> </RelativeLayout>
Vitamio视频播放的更多相关文章
- vitamio视频播放库
vitamio视频播放库 http://www.d evstore.cn/evaluation/testInfo/155-181.html
- Vitamio视频播放器
前言 虽然Android已经内置了VideoView组件和MediaPlayer类来支持开发视频播放器,但支持格式.性能等各方面都十分有限,这里与大家一起利用免费的Vitamio来打造属于自己的And ...
- Vitamio 视频播放
资料总结 Vitamio官网:https://www.vitamio.org 源码地址:https://github.com/yixia/VitamioBundle 最佳教程:大名鼎鼎的农民伯伯博客 ...
- 非常有用的GitHub链接
平常开发工作中,我经常取Github上搜索项目,Clone下来学习使用,在这个过程中,发现了好多比较好的Github地址,记录下来,分享出去. image 非常有用的GitHub链接(顺序不分先后): ...
- github视频录制播放相关功能-参考
lookingstars/JZVideoDemo 视频播放器 Updated on 11 Aug Objective-C 15 10 caoguoqing/VideoEditDemo iOS vi ...
- 视频播放-VideoVIew,Vitamio
播放视频文件其实并不比播放音频文件复杂,主要是使用 VideoView类来实现的.这个类将视频的显示和控制集于一身,使得我们仅仅借助它就可以完成一个简易的视频播放器.VideoView的用法和 Med ...
- 玩转Android之在线视频播放控件Vitamio的使用
其实Android中自带的MediaPlayer本身就能播放在线视频,MediaPlayer结合SurfaceView播放在线视频也是不错的选择(如果你没有性能或者用户体验上的要求),关于MediaP ...
- Android开发学习之路--基于vitamio的视频播放器(二)
终于把该忙的事情都忙得差不多了,接下来又可以开始good good study,day day up了.在Android开发学习之路–基于vitamio的视频播放器(一)中,主要讲了播放器的界面的 ...
- Android开发学习之路--基于vitamio的视频播放器(一)
之前也试过vitamio这个库,后来不知道被什么事情给耽搁了,就没继续下去.近来觉得视频还是需要学习一下的,谁让直播那么火呢,就想着写一个简单的视频播放的app先吧.好了那就开始吧,暂时取名为JP ...
随机推荐
- Linux配置完iptables后,重启失效的解决方案
Linux配置完iptables后,重启失效的解决方案 因为只有root用户才可访问1024以下的端口,非root用户登陆是不能启用80端口的.web service 往往启动1024以上的端口,并通 ...
- Binary Search Tree BST Template
Use one queue + size variable public class Solution { public ArrayList<ArrayList<Integer>&g ...
- 【HDU 4738 Caocao's Bridges】BCC 找桥
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4738 题意:给定一个n个节点m条边的无向图(可能不连通.有重边),每条边有一个权值.判断其连通性,若双 ...
- pyqt QTimer,QThread例子学习
# -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import * from PyQ ...
- robots.txt网站爬虫文件设置
目录: 什么是robots.txt robots.txt使用误区 robots.txt使用技巧 什么是robots.txt? robots.txt是搜索引擎中访问网站的时候要查看的第一个文件.Robo ...
- [Immutable.js] Using fromJS() to Convert Plain JavaScript Objects into Immutable Data
Immutable.js offers the fromJS() method to build immutable structures from objects and array. Object ...
- fedora 20下安装vim的C++补全插件clang_complete
1.安装clang yum install clang 2.安装clang_complete插件 git clone https://github.com/Rip-Rip/clang_complete ...
- "git rm" 和 "rm" 的区别
"git rm" 和 "rm" 的区别 FEB 3RD, 2013 | COMMENTS 这是一个比较肤浅的问题,但对于 git 初学者来说,还是有必要提一下的 ...
- 涂抹Oracle笔记1-创建数据库及配置监听程序
一.安装ORACLE数据库软件及创建实例OLTP:online transaction processing 指那些短事务,高并发,读写频繁的数据库系统.--DB_BLOCK_SIZE通常设置较小.O ...
- Linq GroupJoin 使用
备忘: var data = BoshccEntities.Current.TB_MB_1 .GroupJoin(BoshccEntities.Current.TB_MB_2, o => o.H ...