- Android
- 2011-12-13
MediaPlayer mediaPlayer = new MediaPlayer(); String path = ""; mediaPlayer.setLooping(true); //ループ再生の設定 try { mediaPlayer.setDataSource(path); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try { mediaPlayer.prepare(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } mediaPlayer.start(); //再生開始 mediaPlayer.pause(); //一時停止 mediaPlayer.stop(); //停止
6,281 views