IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label Resume. Show all posts
Showing posts with label Resume. Show all posts

Wednesday, March 27, 2013

Stop and Resume audio from other view controller iOS AVPlayer

I have an app that plays sound when it loads. This happens in the AppDelegate.m file because the audio is used in most places. But I would like to pause the sound when the user clicks on the help menu because the help menu contains a help video and I do not want the sound to interfere. And when the user goes back to the main menu I want the sound to resume. Basically I would like to access the sound and perform things on it. How can I do this.

Thanks in advance!

 

AppDelegate.m:

- (void)applicationDidBecomeActive:(UIApplication *)application

{

      

   NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/AppMusic.mp3", [[NSBundle mainBundle] resourcePath]]];

 

          NSError *error;

  audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];

  audioPlayer.numberOfLoops = INFINITY;

 

          [audioPlayer play];

   

}


View the original article here

Stop and Resume audio from other view controller iOS AVPlayer

I have an app that plays sound when it loads. This happens in the AppDelegate.m file because the audio is used in most places. But I would like to pause the sound when the user clicks on the help menu because the help menu contains a help video and I do not want the sound to interfere. And when the user goes back to the main menu I want the sound to resume. Basically I would like to access the sound and perform things on it. How can I do this.

Thanks in advance!

 

AppDelegate.m:

- (void)applicationDidBecomeActive:(UIApplication *)application

{

      

   NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/AppMusic.mp3", [[NSBundle mainBundle] resourcePath]]];

 

          NSError *error;

  audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];

  audioPlayer.numberOfLoops = INFINITY;

 

          [audioPlayer play];

   

}


View the original article here