Showing posts with label MediaPlayer. Show all posts
Showing posts with label MediaPlayer. Show all posts

Thursday, February 9, 2012

The Music Player Framework in iPhone

Getting started: MPMusicPlayerController

You need to add MediaPlayer.framework to your target in Xcode and #import <MediaPlayer/MediaPlayer.h>. To control music playback, we use an instance of MPMusicPlayerController. There are two types of music players. The iPodMusicPlayer is a reference to the music player instance used by the iPod app. Any settings you change, such as the shuffle or repeat modes, will be changed in the iPod app, too. If the iPod is playing when your application starts, the music will continue playing and you can access the current song and skip back and forward through the currently active playlist. When your app quits, the music will continue playing. I imagine this mode is very handy for most utility apps that try to improve your music listening experience by interacting with the iPod.
.

Thursday, May 5, 2011

Playing Video file in Iphone


Let’s start by looking at a short video of the application. The basic idea to make this work is simple, your video content viewable in your simulator.
Step 1: Create a new project from Xcode using View-base application.
Step 2: We need to add some code in the header file.
#import <MediaPlayer/MediaPlayer.h>
#import <UIKit/UIKit.h> @interface Tabbar1ViewController : UIViewController { MPMoviePlayerController *moviePlayer; NSURL *movieURL; }
Step 3: Now you add MediaPlayer.framework in your framework folder.Only shows up in the iPhone SDK frameworks folder, at  /Developer/platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks.