Video cannot be played Android Vitamio library

邮差的信 提交于 2019-12-10 11:51:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!