private void play() { try { enableNotification(); if (!fullReset()) return; // say(activity, "started " + currentTitle()); mediaPlayer.start(); mediaMode = MediaMode.Playing; saveState(); } catch (Exception e) { TraceUtil.report(e); } }
public void moveTo(double d) { if (mediaMode == MediaMode.UnInitialized) { if (currentDuration() == 0) return; metaHolder.get(currentPodcastInPlayer).setCurrentPos((int) (d * currentDuration())); mediaPlayer.reset(); try { mediaPlayer.setDataSource(currentFile().toString()); mediaPlayer.prepare(); } catch (Exception e) { TraceUtil.report(e); } mediaMode = MediaMode.Paused; return; } mediaPlayer.seekTo((int) (d * mediaPlayer.getDuration())); }