Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class SimplePlayer {
- private Context c;
- private String filePath;
- public SimplePlayer(Context c, String filePath) {
- this.c = c;
- this.filePath = filePath;
- }
- public void play() throws IOException {
- MediaPlayer mediaPlayer = new MediaPlayer();
- mediaPlayer.setDataSource(filePath);
- mediaPlayer.prepare();
- mediaPlayer.start();
- }
- public void destroy(){
- c = null;
- filePath = null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement