Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public static class SimplePlayer {
  2.  
  3. private Context c;
  4. private String filePath;
  5.  
  6. public SimplePlayer(Context c, String filePath) {
  7. this.c = c;
  8. this.filePath = filePath;
  9. }
  10.  
  11. public void play() throws IOException {
  12. MediaPlayer mediaPlayer = new MediaPlayer();
  13. mediaPlayer.setDataSource(filePath);
  14. mediaPlayer.prepare();
  15. mediaPlayer.start();
  16. }
  17.  
  18. public void destroy(){
  19. c = null;
  20. filePath = null;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement