import android.app.*; import android.media.*; import android.net.*; // do not call in ui thread. // waits until playback done. static void androidPlayMp3(Activity androidContext, File mp3) { final MediaPlayer mPlayer = MediaPlayer.create(androidContext, Uri.fromFile(mp3)); final new Flag done; mPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { public void onCompletion(MediaPlayer mp) { mPlayer.release(); done.raise(); } }); mPlayer.start(); done.waitUntilUp(); }
Began life as a copy of #1001270
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1001271 | 
| Snippet name: | androidPlayMp3 | 
| Eternal ID of this version: | #1001271/1 | 
| Text MD5: | bfe77de2836f623f2d741034b3363646 | 
| Author: | stefan | 
| Category: | |
| Type: | JavaX fragment (include) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2016-05-07 13:50:46 | 
| Source code size: | 546 bytes / 21 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 892 / 1205 | 
| Referenced in: | [show references] |