CONNECT Player SDK 5 for Android

Live Epoch time

Application needs to get playback position according to Unix Epoch time sometimes for live streams. The application can calculate current live EPOCH position by getting a timeline object from OTVVideoView instance. The timeline object contains the value of live window start time since Epoch.

Java
private long getLiveCurrentEpochTime() {
  long currentTimeMs = 0;
  OTVTimeline timeline = mOTVVideoView.getCurrentTimeline();
  if (timeline != null) {
    if (timeline.getWindowCount() == 1) {
      OTVTimeline.OTVWindow window = new OTVTimeline.OTVWindow();
      timeline.getWindow(0, window);
      currentTimeMs = mOTVVideoView.getCurrentPosition() + window.windowStartTimeMs;
    } 
  }
  return currentTimeMs;
}