ÆÄÀÏ À§Ä¡¿¡ µû¸¥ ¹Ìµð¾î Àç»ý »ùÇÃÄÚµå |
|
|
 |
8³â Àü |
[¿Àµð¿À Àç»ý]
* ÆÐÅ°ÁöÀÇ assets/audio/oh.mp3 Ç÷¹ÀÌ
AssetFileDescriptor afd = getAssets().openFd("audio/oh.mp3");
MediaPlayer audio_play = new MediaPlayer();
audio_play.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
afd.close();
audio_play.start();
* ÆÐÅ°ÁöÀÇ res/raw/oh.mp3 Ç÷¹ÀÌ
MediaPlayer audio_play = MediaPlayer.create(context, R.raw.oh);
audio_play.start();
* ÆÄÀϽýºÅÛÀÇ /data/oh.mp3 Ç÷¹ÀÌ
MediaPlayer audio_play = new MediaPlayer();
audio_play.setDataSource("/data/oh.mp3");
audio_play.start();
[ºñµð¿À Àç»ý]
* ÆÄÀϽýºÅÛÀÇ /data/oh.mp4 Ç÷¹ÀÌ
VideoView video = (VideoView) findViewById(R.id.video);
MediaController nc = new MediaController(this);
nc.setMediaPlayer(video);
video.setVideoPath("/data/oh.mp4");
video.start();
* ÆÐÅ°ÁöÀÇ res/raw/oh.mp4 Ç÷¹ÀÌ
VideoView¿¡¼´Â ÆÐÅ°ÁöÀÇ ¸®¼Ò½º ÆÄÀÏ Àç»ý ºÒ°¡Çϸç Á÷Á¢ MediaPlayer¸¦ ÀÌ¿ëÇؾßÇÔ. |
|
̵̧ : 377 |
̵̧
¸ñ·Ï
|
|