grez grez - 7 months ago 69
Swift Question

Use MPMoviePlayerController if iOS 7

I have an app which uses the

AVplayerViewController
class and now I wish to support iOS 7. How can I use the
MPMoviePlayerController
instead if iOS 7 is running?

Answer

in swift you can do it like this

if #available(iOS 8, *) {
    let player = AVplayerViewController()
} else {
    //fallback to MVMovie
}