Adding an MPMoviePlayerController in full screen mode?

前端 未结 2 1414
萌比男神i
萌比男神i 2020-12-29 13:32

I have a UIButton in my iPhone app that, when clicked, plays a movie. The code to play the movie looks like this:

NSURL *url = [[NSBundle mainBundle] URLFor         


        
2条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 14:17

    I think the best way to resolve it is using the MPMoviePlayerViewController instead of the MPMoviePlayerController.

    The MPMoviePlayerViewController class implements a simple view controller for displaying full-screen movies. Unlike using an MPMoviePlayerController object on its own to present a movie immediately, you can incorporate a movie player view-controller wherever you would normally use a view-controller.

    To present a movie player view controller modally, you typically use the presentMoviePlayerViewControllerAnimated: method. This method is part of a category on the UIViewController class and is implemented by the Media Player framework. The presentMoviePlayerViewControllerAnimated: method presents a movie player view controller using the standard transition animations for presenting video content. To dismiss a modally presented movie player view controller, call the dismissMoviePlayerViewControllerAnimated method.

提交回复
热议问题