4

Working on an iOS project that uses HTTP Live Streaming (HLS), we found that when the app uses AirPlay, to play the streaming on a Apple TV, the currentDate property of the currentItem of the AVPlayer returns nil. In other words:

AVPlayerItem *item = [player currentItem]; //Where "player" is the AVPlayer object.
NSDate *date = [item currentDate]; //date is nil, when using AirPlay.

So, is it possible to get that currentDate by other means?

javiergov
  • 953
  • 6
  • 17
LuisEspinoza
  • 8,508
  • 6
  • 35
  • 57

1 Answers1

0

You should include EXT-X-PROGRAM-DATE-TIME tag info in your m3u8 files. For example, if I created a live stream at 2017/7/12 12:00:00

I should add

#EXT-X-PROGRAM-DATE-TIME:2017-07-12T12:00:00.000Z in my .m3u8 header

and you will get currentDate when you call the method in playerItem.(However, that date info is only supported to s not ms unit.)

Jerome Li
  • 1,492
  • 14
  • 20