Upgraded the iphone5 to Ios 7.1.1. and it started to work. Don't know if it was the reboot of iphone or upgrade that helped. However videos recorded with the iphone don't usually start playing on TV immediately, you need to start playing it on iphone and then change to airplay when video starts to play.
One thing I did not get to work is m3u8 streams played from iphone or ipad.