这是我的班级
public class VideoViewActivity extends Activity implements OnInfoListener, OnBufferingUpdateListener {
boolean isStart;
VideoView mVideoView;
ProgressBar pb;
TextView downloadRateView, loadRateView;
String videourl = "";
ImageView img_add;
ImageLoader imageLoader = ImageLoader.getInstance();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!LibsChecker.checkVitamioLibs(this))
return;
setContentView(R.layout.video_view);
img_add = (ImageView) findViewById(R.id.img_add);
// imageLoader.init(GetOption.getConfig(this));
WebAPIHelper web = new WebAPIHelper(Constant.videoaddimage, VideoViewActivity.this, true);
web.callRequestGet("http://fillatv.com/fillatv/service/get_banners.php");
pb = (ProgressBar) findViewById(R.id.probar);
downloadRateView = (TextView) findViewById(R.id.download_rate);
loadRateView = (TextView) findViewById(R.id.load_rate);
mVideoView = (VideoView) findViewById(R.id.surface_view);
mVideoView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return false;
}
});
Button btn_back = (Button) findViewById(R.id.back);
btn_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
VideoViewActivity.this.finish();
}
});
Intent intent = getIntent();
videourl = ((DataContainer) intent.getSerializableExtra("v_url")).link;
//videourl = intent.getStringExtra("v_url");
PlayVideo();
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onPause() {
super.onPause();
}
private void PlayVideo() {
Log.e("video url", videourl);
Uri uri = Uri.parse(videourl);
mVideoView.setVideoURI(uri);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.setOnInfoListener(this);
mVideoView.setOnBufferingUpdateListener(this);
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
// optional need Vitamio 4.0
mediaPlayer.setPlaybackSpeed(1.0f);
}
});
mVideoView.setOnErrorListener(new OnErrorListener() {
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
Toast.makeText(getApplicationContext(), "no Streaming Found try after some time", Toast.LENGTH_LONG).show();
finish();
return false;
}
});
}
@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
switch (what) {
case MediaPlayer.MEDIA_INFO_BUFFERING_START:
if (mVideoView.isPlaying()) {
mVideoView.pause();
isStart = true;
pb.setVisibility(View.VISIBLE);
downloadRateView.setVisibility(View.VISIBLE);
loadRateView.setVisibility(View.VISIBLE);
}
break;
case MediaPlayer.MEDIA_INFO_BUFFERING_END:
if (isStart) {
mVideoView.start();
pb.setVisibility(View.GONE);
downloadRateView.setVisibility(View.GONE);
loadRateView.setVisibility(View.GONE);
}
break;
case MediaPlayer.MEDIA_INFO_DOWNLOAD_RATE_CHANGED:
downloadRateView.setText(" " + extra + "kb/s" + " ");
break;
}
return true;
}
@Override
public void onBufferingUpdate(MediaPlayer mp, int percent) {
loadRateView.setText(percent + "%");
}
public void viewdata(String data) {
String img;
try {
JSONArray j_array = new JSONArray(data);
for (int i = 0; i < j_array.length(); i++) {
JSONObject j_obj = j_array.getJSONObject(i);
System.out.print(j_obj.getString("status"));
System.out.print(j_obj.getString("id"));
System.out.print(j_obj.getString("Image"));
img = j_obj.getString("Image");
imageLoader.displayImage(img, img_add, GetOption.getOption());
}
} catch (Exception e) {
}
}
}
尝试运行时显示以下错误。花了一天时间来解决这个问题,但找不到重要的希望,你们有解决方案。
E/Vitamio[4.2.6][Player]: FIND_NAME_SYM vvo, render_yuv
11-26 18:59:29.556 28707-28882/com.fillatv.live E/Vitamio[4.2.6][Player]: avformat_open_input: Invalid data found when processing input : -1094995529
11-26 18:59:29.556 28707-28879/com.fillatv.live E/Vitamio[4.2.6][Player]: error (1, -1094995529)
11-26 18:59:29.637 28707-28707/com.fillatv.live E/Vitamio[Player]: Error (1, -1094995529)
如果有人需要更多细节请告诉我,我会提供。任何帮助将不胜感激,提前致谢。