问题
I am using vitamio library for rtsp stream. I am getting : "Sorry this video cannot be played" error. File format of the video is .H264. Where is my mistake ? Have you ever used vitamio library ?
VideoActivity.java code as below :
public class VideoActivity extends AppCompatActivity {
private String path;
private VideoView mVideoView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video);
if (!LibsChecker.checkVitamioLibs(this))
return;
mVideoView = (VideoView) findViewById(R.id.vitamio_videoView);
path = "rtsp://IP_ADRESS:PORT/sub1";
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mediaPlayer.setPlaybackSpeed(1.0f);
}
});
}
}
来源:https://stackoverflow.com/questions/35134948/video-cannot-be-played-android-vitamio-library