android第三方视频解码器Vitamio SDK使用后的感觉(2014.03.11)
程序员文章站
2024-01-17 19:47:46
...
Vitamio官方网址:http://www.vitamio.org/
Vitamio SDK下载地址:
https://github.com/yixia/VitamioBundle
Vitamio Demo下载地址:
https://github.com/yixia/VitamioDemo
已经存在我网盘的 Vitamio SDK下载地址:
http://www.kuaipan.cn/file/id_183989904970109245.htm
已经存在我网盘的 Vitamio Demo下载地址:
http://www.kuaipan.cn/file/id_183989904970109244.htm
Vitamio 封装了一个VideoView类,可以向android提供的API一样调用VideoView,使用方便…
public class VideoViewDemo extends Activity {
/**
* TODO: Set the path variable to a streaming video URL or a local media
* file path.
*/
private String path = "http://v.youku.com/player/getRealM3U8/vid/XNDUwNjc4MzA4/type/video.m3u8";
private VideoView mVideoView;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (!LibsChecker.checkVitamioLibs(this))
return;
setContentView(R.layout.videoview);
mVideoView = (VideoView) findViewById(R.id.surface_view);
if (path == "") {
// Tell the user to provide a media file URL/path.
Toast.makeText(
VideoViewDemo.this,
"Please edit VideoViewDemo Activity, and set path"
+ " variable to your media file URL/path",
Toast.LENGTH_LONG).show();
return;
} else {
/*
* Alternatively,for streaming media you can use
* mVideoView.setVideoURI(Uri.parse(URLstring));
*/
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView
.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
// optional need Vitamio 4.0
// mediaPlayer.setPlaybackSpeed(1.0f);
}
});
}
}
}
看完Vitamio SDK以及Demo,特别想做一个类似“爱奇艺”的视频客户端。之前在联想曾经做过一个视频客户端,但对于视频解码,可以说一窍不通,该SDK可以让我们不用关心视频解码的远离,顶一个!!!