I believe you'll want to connect the PS4 to the sound bar, not your TV. Make use of the optical S/PDIF output connection available on the PS4.
It should be HDMI from PS4 to TV and optical out to the soundbar. Then set options on the TV to use that output instead of the internal speakers. It may work the other way but is a bit messier since any other input to the TV won't play through the soundbar.