Tag Archives: Play

Play a movie in fullscreen (Objective-C)

Hi, In reply to http://snipd.net/objective-c-play-a-video-in-full-screen#comment-290 . The following snippets show how to play a movie in fullscreen.

Posted in Objective-C | Also tagged , , , , , , | Leave a comment

(Objective C) Play a sound file

// Play sound //To load sound file. +(void) playSound:(NSString *)fileName { NSString *path = [NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle] resourcePath],fileName];</code> <code>//declare a system sound id SystemSoundID soundID; //Get a URL for the sound file NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO]; //Use audio sevices to create the sound AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID); </code> <code> //Use audio services to play the [...]

Posted in Objective-C | Also tagged , , , , , , , | Leave a comment

(Objective C) Play a video in full screen

1. include MediaPlayer framework in the project 2. in the view controller header file, #import 3. declare the player instance in the controller header file: MPMoviePlayerViewController *playerViewController;

Posted in Objective-C | Also tagged , , , , | 3 Comments