ITV is in talks to sell its media unit amid profit struggles, as streaming giants like HBO Max and YouTube expand their digital content.