rtsp 주소로 동영상을 스트리밍 하려 합니다. 서버는 vlc를 쓰고
그런데 비디오 재생을 누르면 로그에
01-11 22:21:30.706: V/MediaPlayer-JNI(27964): stop
01-11 22:21:30.706: V/MediaPlayer(27964): stop
01-11 22:21:30.706: E/MediaPlayer(27964): stop called in state 0
01-11 22:21:30.706: V/MediaPlayer(27964): message received msg=100, ext1=-38, ext2=0
01-11 22:21:30.706: E/MediaPlayer(27964): error (-38, 0)
01-11 22:21:30.706: V/MediaPlayer(27964): callback application
01-11 22:21:30.706: V/MediaPlayer(27964): back from callback
01-11 22:21:30.706: E/MediaPlayer(27964): Error (-38,0)
01-11 22:21:30.706: V/MediaPlayer-JNI(27964): stop
이것만 무한 찍힙니다. 재생 누르면 비디오 재생되는 액티비티로 갔다가 바로 돌아오구요 중지되거나 그러지는 않습니다.
찾아보니까 prepared 쪽 관련이라는 말이 많아
onPrepared함수 안에
// Start video
if (!player.isPlaying()) {
player.start();
updateMediaProgress();
linearLayoutMediaController.setVisibility(View.VISIBLE);
hideMediaController();
}
이렇게 해놓았고
surfaceCreate부분에는
public void surfaceCreated(SurfaceHolder holder) {
playVideo();
player.setDisplay(holder);
}
이렇게 되어있습니다.
playVideo 함수는 아래와 같습니다.
private void playVideo() {
if (extras.getString("video_path").equals("VIDEO_URI")) {
showToast("Please, set the video URI in HelloAndroidActivity.java in onClick(View v) method");
} else {
new Thread(new Runnable() {
public void run() {
try {
player.setDataSource(extras.getString("video_path"));
player.prepareAsync();
} catch (IllegalArgumentException e) {
showToast("Error while playing video");
Log.i(TAG, "========== IllegalArgumentException ===========");
e.printStackTrace();
} catch (IllegalStateException e) {
showToast("Error while playing video");
Log.i(TAG, "========== IllegalStateException ===========");
e.printStackTrace();
} catch (IOException e) {
showToast("Error while playing video. Please, check your network connection.");
Log.i(TAG, "========== IOException ===========");
e.printStackTrace();
}
}
}).start();
}
}
저에러는 무슨뜻이죠??!