How to play video file in iOS


Create project with singleViewApplication.

1)First Add the mediaPlayerFramework. >> Build Phases >> Link Binary with lib.. and search there MediaPlayer.framework

mediaPlayerFramework

2)select storyboard and in viewController add a button with the name of TapMe.

iOS Tap me button

3)select viewController.h and drag the TapMe button with the Action and touchUpInside event.

4)open the viewContoller.m  and in TapMe method try following code

-(IBAction)TapMe {

media framework in ios}

Finally build and run

Media Player Framework

The Media Player framework (MediaPlayer.framework) provides high-level support for playing audio and video content from your app. You can use this framework to do the following:

  • Play video to a user’s screen or to another device over AirPlay. You can play this video full screen or in a resizable view.
  • Access the user’s iTunes music library. You can play music tracks and playlists, search for songs, and present a media picker interface to the user.
  • Configure and manage movie playback.
  • Display Now Playing information in the lock screen and App Switcher. You can also display this information on an Apple TV when content is delivered via AirPlay.
  • Detect when video is being streamed over AirPlay

Kalavati Technologies Pvt Ltd