File f = new File("/sdcard/Sample.3gp");
byte[] videoUp=new byte[576600];
videoUp = IOUtils.toByteArray( new FileInputStream(f));
//我希望在将其转换为字节后播放视频 当我转换并放入视频时,nothning会让它播放。
答案 0 :(得分:0)
试试这个:
VideoView videoView = (VideoView) findViewById(R.id.VideoView01);
MediaController mediaController = new MediaController(this);
mediaController.setMediaPlayer(videoView);
videoView.setVideoPath(path);
videoView.setMediaController(mediaController);
videoView.requestFocus();
videoView.start();
mediaController.show();
答案 1 :(得分:0)
相反,你可以直接从sdcard播放视频,
VideoView videoView = (VideoView) findViewById(R.id.videoView);
videoView.setVideoPath("/sdcard/Sample.3gp");
videoView.setMediaController(mediaController);
videoView.requestFocus();
videoView.start();
如果您想控制任何播放器选项,可以使用MediaController。