Display the Current Time and Remaining Time

You can display the current and remaining time of the content you are showing.

Implement a display that shows the current and remaining time of the active content, using the following sample code as a guide:
// 1. Register for the PTMediaPlayerTimeChangeNotification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMediaPlayerTimeChange:) 
  name:PTMediaPlayerTimeChangeNotification object:self.player];

...

// 2. Create labels for displaying current and remaining time
_timeCurrentLabel = [[UILabel alloc] initWithFrame:CGRectMake(50.0, 16.0, 50.0, 21.0)];
_timeCurrentLabel.text = @"00:00:00";
_timeCurrentLabel.font = [UIFont boldSystemFontOfSize:12.0];
_timeCurrentLabel.numberOfLines = 1;
_timeCurrentLabel.textAlignment = UITextAlignmentCenter;
_timeCurrentLabel.backgroundColor = [UIColor clearColor];
_timeCurrentLabel.textColor = 
  [UIColor colorWithRed:209.0/255.0 green:209.0/255.0 blue:209.0/255.0 alpha:1.0];
[self addSubview:_timeCurrentLabel];

_timeRemainingLabel = [[UILabel alloc] initWithFrame:CGRectMake(485.0, 16.0, 50.0, 21.0)];
_timeRemainingLabel.text = @"00:00:00";
_timeRemainingLabel.font = [UIFont boldSystemFontOfSize:12.0];
_timeRemainingLabel.numberOfLines = 1;
_timeRemainingLabel.textAlignment = UITextAlignmentCenter;
_timeRemainingLabel.backgroundColor = [UIColor clearColor];
_timeRemainingLabel.textColor = 
  [UIColor colorWithRed:209.0/255.0 green:209.0/255.0 blue:209.0/255.0 alpha:1.0];

...

// 3. This method is called whenever the player time changes 
(PTMediaPlayerTimeChangeNotification) - (void) onMediaPlayerTimeChange:(NSNotification *)notification {
    //The seekable range provides the playback range of a stream 
    CMTimeRange seekableRange = self.player.seekableRange;

    //Verify if the seekableRange is a valid CMTimeRange 
    if (CMTIMERANGE_IS_VALID(seekableRange)) {
        double  duration = CMTimeGetSeconds(seekableRange.duration);
        double currentTime = CMTimeGetSeconds(self.player.currentItem.currentTime); 
        if (CMTIME_IS_INDEFINITE(self.player.currentItem.duration)) {
            //If the duration is indefinite then the content is live. 
            [_timeCurrentLabel setText:[NSString stringWithFormat:@"--:--"]]; 
            [_timeRemainingLabel setText:[NSString stringWithFormat:@"Live"]];
        }
        else {
            [_timeCurrentLabel setText:[self timeFormatter:currentTime]]; 
            [_timeRemainingLabel setText:[self timeFormatter:(duration - currentTime)]];
        }
    }
}