Question

Does Apple provide us with some audio controls like their standard ones we see in Control Center and the native Music app? Something we can add as a subview?

Or do we have to create our own?

Thanks

Was it helpful?

Solution

No, they do not. You have to create all of these controls on your own.

They do however offer several frameworks that are useful when it comes to making music playing applications. Once you create your own buttons, you can hook them up to the music API of your choice.

If you're looking to control the device's built in iPod, you'll want the Media Player Framework, but if you're looking to create something more your own, you probably want AVFoudation.

OTHER TIPS

Try in Simple steps:

Step 1: #import <MediaPlayer/MediaPlayer.h>

Step 2: Set delegate in .h file UIViewController<MPMediaPlayback>

Step 3: Write this code on .m file

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSURL *vedioURL =[NSURL fileURLWithPath:fileLocation];
    MPMoviePlayerViewController *videoPlayerView = [[MPMoviePlayerViewController alloc] initWithContentURL:vedioURL];
    [self presentMoviePlayerViewControllerAnimated:videoPlayerView];
    [videoPlayerView.moviePlayer play];
}

-(void)endSeeking
{
    [self.navigationController popViewControllerAnimated:NO];
}

-(void)stop
{
    [self.navigationController popViewControllerAnimated:NO];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top