dev dev - 3 years ago 403
iOS Question

No "Done" button on AVPlayerViewController

I am using AVPLayerViewController to stream content. Playback works fine but I don't see "Done" button to dismiss the view.

Here is I how I setup and show the view controller

NSURL* url = [content localSessionUrl];
AVPlayerViewController *playerViewController = [[AVPlayerViewController alloc] init];
playerViewController.player = [AVPlayer playerWithURL:url];
[self.navigationController pushViewController:playerViewController animated:YES];
[self.navigationController setNavigationBarHidden:YES];

Is it because I am pushing it on a navigationcontroller?
enter image description here

Answer Source

Yes, the 'Done' button acts as a dismissal for a modal presentation style. If you are pushing the AVPlayerViewController onto the navigation stack you will need to handle the popping yourself.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download