Video [Q] Android Box

Hello
I am new to xda-developers, so if this question is not in correct section excuse me.

So i have android box and tv app on it. app works very goods but our problem is that.

if tv is turned off, android box works anyway and stream goes, so bandwidth load goes high even if i am not watching tv.

Is there any chance to detect that if tv is off, after for example some time, android box will stop streaming or it will just shut down itself.

Thank you