Search code examples
objective-cvideompmovieplayercontrollervideo-player

Objc - how to add a video player inside a UIView like this?


This player only have 2 buttons,play/pause and fullscreen,it looks like a system player,so fast and simple.

I used UIWebView and HTML5 inside the UIView,but UIWebView is so slow and can not play without fullscreen.

If this player is a UIObject or some UIView things,how can I add it?

thanks~

sample video player in app Everyday.me


Solution

  • You can add a video player into your UIView using MPMoviePlayerController.

    Here is Apple sample code which does just like this. It can stream a video from internet as well as play a local movie file.

    You can change the playback controls by changing the moviePlayer controlStyle property.

    You can find the sample code from the link below

    http://developer.apple.com/library/ios/#samplecode/MoviePlayer_iPhone/Introduction/Intro.html