You can use the PSDK to retrieve information about the media that you can then display on the seek bar.
This ensures that the media resource has successfully loaded. If the player is not in the PREPARED state, attempting to call the following methods throws an IllegalStateException.
This returns the current playhead position on the virtual timeline expressed in milliseconds. The time is calculated relative to the resolved stream, which could contain multiple instances of alternate content (multiple ads or ad breaks spliced into the main stream). For live/linear streams, the returned time is always inside the playback window range.
long getCurrentTime() throws IllegalStateException;
This includes the duration of any additional content inserted into the stream (ads)
For VOD, the range always begins with zero and the end value equals the sum of the main content duration and the durations of any additional content inserted into the stream (ads).
For a linear/live asset, the range represents the playback window range. This range changes during playback. The PSDK calls your onUpdated callback to indicate that the media item was refreshed and that its attributes (including the playback range) were updated.
For example, here is a possible layout that contains the SeekBar and two TextView elements.
<LinearLayout
android:id="@+id/controlBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@android:color/black"
android:orientation="horizontal" >
<TextView
android:id="@+id/playerCurrentTimeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:text="00:00"
android:textColor="@android:color/white" />
<SeekBar
android:id="@+id/playerSeekBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/playerTotalTimeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:text="00:00"
android:textColor="@android:color/white" />
</LinearLayout>

The following example uses the Clock.java helper class as the timer, which is available in the PMPDemoApp. This class sets an event listener and triggers an onTick event every second, or another timeout value that you can specify.
playbackClock = new Clock(PLAYBACK_CLOCK, CLOCK_TIMER);
playbackClockEventListener = new Clock.ClockEventListener() {
@Override
public void onTick(String name) {
// Timer event is received. Update the SeekBar here.
}
};
playbackClock.addClockEventListener(playbackClockEventListener);
On every clock tick, this example retrieves the media player's current position and updates the SeekBar. It uses the two TextView elements to mark the current time and the playback range end position as numeric values.
@Override
public void onTick(String name) {
if (mediaPlayer != null && mediaPlayer.getStatus() == PlayerState.PLAYING) {
handler.post(new Runnable() {
@Override
public void run() {
seekBar.setProgress((int)
mediaPlayer.getCurrentTime());
currentTimeText.setText(timeStampToText(
mediaPlayer.getCurrentTime()));
totalTimeText.setText(timeStampToText(
mediaPlayer.getPlaybackRange().getEnd()));
}
});
}
}