It might not work in such circumstances. Your Mac might be able to find the devices to which you want to stream on a different subnet, but the receiving device might not be able to get the video/audio stream from your Mac. In that case, please always make sure that your Mac and the receiving device are connected to the same subnet.