use of com.gwtmobile.phonegap.client.Media.MediaError in project GwtMobile by dennisjzh.
the class MediaUi method play.
public void play() {
text.setHTML("Playing...");
media.play();
timer = new Timer() {
@Override
public void run() {
if (Utils.isAndroid()) {
media.getCurrentPosition(new PositionCallback() {
@Override
public void onSuccess(int position) {
int duration = media.getDuration();
text.setHTML(position + " / " + duration);
}
@Override
public void onError(MediaError error) {
text.setHTML("Get Current Position Error<br/>" + "Code: " + error.getCode() + "<br/>" + "Message: " + error.getMessage());
}
});
} else if (Utils.isIOS()) {
text.setHTML(text.getHTML() + ".");
}
}
};
timer.scheduleRepeating(1000);
}
Aggregations