Detect if TV is turned off on tvOS

 ̄綄美尐妖づ 提交于 2020-12-26 08:30:02

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/52763217/detect-if-tv-is-turned-off-on-tvos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!