2

Does anyone know how, or if, it is possible to detect programmatically on tvOS if the TV is turned off?

The case is that I’m developing a video content app, where I don’t want the content to continue to play when the user turns off the TV. This is expensive due to bandwidth fees and give imprecise analytics.

I’ve tried searching around and could find any clues.

Best regards.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Nam
  • 1,856
  • 2
  • 13
  • 18
  • FWIW - it's certainly not immediately clear from the tvOS docs. Interesting question though, curious to hear if there's an answer. Can you provide any more information on the use case for such a feature? The community may be able to suggest alteratives. – esqew Oct 11 '18 at 15:01
  • 1
    Just added the case, thx. – Nam Oct 11 '18 at 15:25
  • As a workaround, many apps will prompt the user with a "Are you still watching?" after a length of time or number of videos. – picciano Nov 17 '18 at 00:30
  • Thanks, I've considered this as well – Nam Nov 29 '18 at 14:37

1 Answers1

0

FWIW

tvOS does automatically pause the content when the TV is turned off.

In my case I was test on live content. I found out that the property linearPlayback was set to true. This lead to that the AVPlayerViewController was unable to pause the (live) content.

Setting this to false didn't had significant side effects in my case and thus making my case work.

Nam
  • 1,856
  • 2
  • 13
  • 18