我正在为rtsp流使用vitamio库。我收到:“抱歉此视频无法播放”错误。视频的文件格式为.H264。我的错误在哪里?你有没有用过vitamio库?
VideoActivity.java代码如下:
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);
}
});
}
}