Pushing a ViewController and then popping back to the root VC will cause the AVPlayerLayer to be vertically compressed on the root VC

Originator:johnkchow23
Number:rdar://16952666 Date Originated:2014/04/14
Status:Open Resolved:
Product:iOS Product Version:7.1
Classification: Reproducible:Sometimes
 
On the root UIViewController, I'm using the AVPlayerLayer and a AVPlayer to load a file off the web to play a video. On the UI, the red "reply" button will push a new UIViewController onto the UINavigationController's stack to open the front-facing video camera (which uses the AVCaptureSession/AVCaptureVideoPreviewLayer/AVCaptureMovieFileOutput/AVAssetExportSession) to create a video reply. After the recording, we push another UIViewController that uses the MPMoviePlayerController to play the video response, and then pops all the way back to the root UIViewController. Then back on the root VC, the AVPlayerLayer is vertically compressed.

What fixes the issue is either a) going to the Home screen and re-entering the app or b) calling [AVPlayer replaceCurrentItemWithPlayerItem: nil] and then [AVPlayer replaceCurrentItemWithPlayerItem: originalPlayerItem] on viewWillDisappear viewDidAppear respectively.

Attached are screenshots of what it should look like and what happens after multiple pushes.

Steps to Reproduce:


Expected Results:
The AVPlayerLayer should fill its view and respect the aspect ratio of the video (look at the expected.PNG file)

Actual Results:
The AVPlayerLayer is vertically compressed (look at the actual.PNG file)

Version:
iOS 7.1

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!