ios - how to play video in iphone, xcode -


I am creating a movie application in the iPhone. I want to play a video in my application my video URL is locally located Please help me with somebody how do I play a video in my application?

Where is it locally located? In the application bundle? If so, the URL is like this:

  NSURL * url = [NSURL URLWithString: [[NSBundle mainBundle] pathForResource: @ Type of "videoname": @ "mov" in directory: @ ""]];  

You can play most of the video with Apple's Media Player Framework.

Add the framework (media player) to your project and file it as .h , and make an example of a media player like this:

  // H: #import & lt; Media Player / Media Player H & gt; // M: mp3 MPV Player Controller * Player = [[MP MPV Player Controller] INST WITH CONTENT URL: VIDEO-URL]; [[Player View] Setframe: [Auto Wonder Limit]]; // frame should match parent view [self.view addSubview: [player view]]; [Player's game]; [Player release];  


Comments