코드는 아래와 같은데요. rtsp://192.168.60.195/cho/s.mp4가 경로고 와우자서버로 돌렸습니다. 직접 영상을 틀었을 땐 재생이 잘 되었는데요. 비디오플레이어를 아래와같이 만들어서 path로 넣으려니까 되질 않습니다. logcat에
05-06 11:24:00.401: E/MediaPlayer(25490): Unable to to create media player
05-06 11:24:00.401: V/CUSTOM_VIDEO_PLAYER(25490): IOExceptionsetDataSource failed.: status=0x80000000
와 같이 뜨는데 문제가 뭔지 모르겠어요. 읽어들이지를 못하는거 같은데 어떻게 해야되나요ㅜㅠ..답변부탁드립니다.
public class MainActivity extends Activity {
Display currentDisplay;
SurfaceView surfaceview;
SurfaceHolder surfaceholder;
View mainView;
TextView statusview;
MediaPlayer mediaplayer;
MediaController controller;
int videowidth =0;
int videoheight = 0;
boolean readyToPlay;
public final static String LOGTAG = "CUSTOM_VIDEO_PLAYER";
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
surfaceview = (SurfaceView)findViewById(R.id.surfaceView1);
surfaceholder=surfaceview.getHolder();
surfaceholder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mainView = this.findViewById(R.id.MainView);
statusview = (TextView)findViewById(R.id.statusview);
mediaplayer = new MediaPlayer();
String filepath = "rtsp://192.168.60.195/cho/s.mp4";
try {
mediaplayer.setDataSource(filepath);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
Log.v(LOGTAG, "IllegalArgumentException" + e.getMessage());
finish();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
Log.v(LOGTAG, "IllegalStateException" + e.getMessage());
finish();
} catch (IOException e) {
// TODO Auto-generated catch block
Log.v(LOGTAG, "IOException" + e.getMessage());
finish();
}
statusview.setText("MediaPlayer DataSource Set");
currentDisplay = getWindowManager().getDefaultDisplay();
controller = new MediaController(this);