If the soundbar includes an HDMI input and HDMI output/ARC port, you can connect a PS5 to it. According to Soundbar Mag, the preferable method is to connect the PS5 to the HDMI input on the TV and the soundbar to the HDMI ARC/eARC port.