

Is there a way to do this with LL scripting and if so, do you have any tips or coding or anything to share that will help? Thanks!
Code: Select all
bindClass("android.media.MediaPlayer");
var item = getEvent().getItem();
function stop() {
item.setLabel(item.getTag("label"));
item.setTag("label",null);
item.my.player.stop();
item.my.player.release();
}
if(item.getTag("label")==null){
item.my.player = MediaPlayer.create(getActiveScreen().getContext(), Uri.parse("file://"+getEvent().getData()));
item.my.player.start();
item.my.player.setOnCompletionListener(function(mp){stop();});
item.setTag("label",item.getLabel());
item.setLabel("Stop");
} else {
stop();
}