A. Check your phone's battery optimization settings. Go to 'Settings' > 'Battery' > 'Battery Optimization' and ensure that Xtream IPTV is not optimized, which can prevent it from running in the background when the screen is locked.
B. Consider using a screen mirroring app that allows you to cast without interruption, such as 'Miracast' or 'Screen Stream Mirroring'.