Britney Spears' ex-husband, Kevin Federline, has suffered a heart scare while filming a weight loss show.