iOS development--simple implementation with Mpmovieplayerviewcontroller video playback

Source: Internet
Author: User

I. Mpmovieplayerviewcontroller and MPMoviePlayerController districts, the former inheriting from NSObject, the latter inheriting from Uiviewcontroller

Two. Mpmovieplayerviewcontroller can only be played in the form of modal, and must be played in full screen

1 #import "ViewController.h"2 #import<MediaPlayer/MediaPlayer.h>3 4 @interfaceViewcontroller ()5 6 /*Create a playback controller*/7@property (nonatomic, strong) Mpmovieplayerviewcontroller *PLAYERVC;8-(ibaction) play;9 Ten @end One  A @implementationViewcontroller -  -- (void) Viewdidload { the [Super Viewdidload]; - } -  - #pragmaMark-Lazy Loading code +-(Mpmovieplayerviewcontroller *) PLAYERVC - { +     if(_PLAYERVC = =Nil) { ANsurl *url = [Nsurl urlwithstring:@"Http://v1.mukewang.com/19954d8f-e2c2-4c0a-b8c1-a4c826b5ca8b/L.mp4"]; at          -_PLAYERVC =[[Mpmovieplayerviewcontroller alloc] initwithcontenturl:url]; -     } -     return_PLAYERVC; - } -  in-(ibaction) play { - [self presentViewController:self.playerVc animated:yes completion:nil]; to } +  - @end

iOS development--simple implementation with Mpmovieplayerviewcontroller video playback

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.