Search code examples
objective-cavplayertvosavplayerviewcontroller

Customising AVPlayerViewController progress bar


I am working on AVPlayerViewController and using it I am playing HLS video. Is it possible to add some dots at different time interval(e.g. at 10 , 20 etc minutes yellow dots) on progress bar in tvOS?

Or is their any other approach using which I can achieve this.


Solution

  • Finally got the answer after going through apple developer blog and various other blogs

    We can use setInterstitialTimeRanges method to set InterstitialTimeRanges property of AVPlayerItem

    [self.playerItem setInterstitialTimeRanges:self.timeRangeArray];

    where self.timeRangeArray is an array of AVInterstitialTimeRange objects which will be shown on progress bar of AVPlayerViewController.