public long getTrackDurationSeconds() { return getTrackDuration() == null ? 0 : ModelUtil.fromTimeString(getTrackDuration()); }
public long getTrackElapsedSeconds() { return getRelTime() == null || getRelTime().equals("NOT_IMPLEMENTED") ? 0 : ModelUtil.fromTimeString(getRelTime()); }
@Override public void seek(UnsignedIntegerFourBytes instanceId, String unit, String target) throws AVTransportException { final GstMediaPlayer player = getInstance(instanceId); SeekMode seekMode; try { seekMode = SeekMode.valueOrExceptionOf(unit); if (!seekMode.equals(SeekMode.REL_TIME)) { throw new IllegalArgumentException(); } final ClockTime ct = ClockTime.fromSeconds(ModelUtil.fromTimeString(target)); if (player.getPipeline().getState().equals(State.PLAYING)) { player.pause(); player.getPipeline().seek(ct); player.play(); } else if (player.getPipeline().getState().equals(State.PAUSED)) { player.getPipeline().seek(ct); } } catch (IllegalArgumentException ex) { throw new AVTransportException( AVTransportErrorCode.SEEKMODE_NOT_SUPPORTED, "Unsupported seek mode: " + unit ); } }
public long getTrackDurationSeconds() { return getTrackDuration() == null ? 0 : ModelUtil.fromTimeString(getTrackDuration()); }
public long getTrackElapsedSeconds() { return getRelTime() == null || getRelTime().equals("NOT_IMPLEMENTED") ? 0 : ModelUtil.fromTimeString(getRelTime()); }
public long getTrackDurationSeconds() { return getTrackDuration() == null ? 0 : ModelUtil .fromTimeString(getTrackDuration()); }
public long getTrackDurationSeconds() { return getTrackDuration() == null ? 0 : ModelUtil.fromTimeString(getTrackDuration()); }
public long getTrackElapsedSeconds() { return getRelTime() == null || getRelTime().equals("NOT_IMPLEMENTED") ? 0 : ModelUtil.fromTimeString(getRelTime()); }
public long getTrackElapsedSeconds() { return getRelTime() == null || getRelTime().equals("NOT_IMPLEMENTED") ? 0 : ModelUtil.fromTimeString(getRelTime()); }
/** * 设置跳转时间 * @param totalTime 媒体总时长 * @param percent 跳转的百分比 */ public void seek(String totalTime, int percent) { long duration = ModelUtil.fromTimeString(totalTime); long seekTime = percent * duration / 100; String seekTo = ModelUtil.toTimeString(seekTime); upnpBiz.execute(new Seek(instanceId, serviceAVT, seekTo) { @Override public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMsg) { LogUtil.d(TAG, "Seek failure:" + defaultMsg); } @Override public void onSuccess(String defaultMsg) { LogUtil.d(TAG, "Seek successed:" + defaultMsg); Message msg = Message.obtain(handler); msg.what = MediaControlWhat.SEEK; msg.arg1 = SUCCESS; msg.sendToTarget(); } }); }