CONNECT Player SDK 5 for Android
5.42.x 5.41.x 5.40.x 5.39.x 5.38.x 5.37.x 5.36.x 5.35.x 5.34.x 5.33.x 5.32.x 5.31.x 5.30.x 5.29.x 5.28.x 5.27.x 5.26.x 5.25.x 5.24.x 5.23.x 5.22.x 5.21.x 5.20.x 5.19.x 5.18.x 5.17.x 5.16.x 5.15.x 5.14.x 5.13.x 5.12.x 5.11.x 5.10.x 5.9.x 5.8.x 5.7.x 5.6.x 5.5.x
5.42.x 5.41.x 5.40.x 5.39.x 5.38.x 5.37.x 5.36.x 5.35.x 5.34.x 5.33.x 5.32.x 5.31.x 5.30.x 5.29.x 5.28.x 5.27.x 5.26.x 5.25.x 5.24.x 5.23.x 5.22.x 5.21.x 5.20.x 5.19.x 5.18.x 5.17.x 5.16.x 5.15.x 5.14.x 5.13.x 5.12.x 5.11.x 5.10.x 5.9.x 5.8.x 5.7.x 5.6.x 5.5.x

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;
}