Added AVFoundation code