开发者

possibilities to open playlist tab directly by using MPMediaPickerController

I am implementing a basic application that which allows to select a play list from music with in the application. I 开发者_如何学Gomake it. But my problem is it is showing directly Music tab directly. But as per my requirements I need to show the playlist tab when the user takes to that view. Following is my code,

   MPMediaPickerController *picker =
    [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic];

    picker.delegate                     = self;
    picker.allowsPickingMultipleItems   = YES;
    picker.prompt                       = NSLocalizedString (@"Select any song from the list", @"Prompt to user to choose some songs to play");

    // The media item picker uses the default UI style, so it needs a default-style
    //      status bar to match it visually
    [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleDefault animated: YES];

    [self presentModalViewController: picker animated: YES];
    [picker release];


-(IBAction)btnSelectSong:(id)sender
{

       MPMediaPickerController *picker =
        [[MPMediaPickerController alloc]
         initWithMediaTypes: MPMediaTypeAnyAudio];

        [picker setDelegate: self];
        [picker setAllowsPickingMultipleItems: YES];
        picker.prompt =
        NSLocalizedString (@"Add songs to play",
                           "Prompt in media item picker");

        [self presentModalViewController: picker animated: YES];

}


opening in the playlist section of MPMediaPickerController is not possible according to Apple's documentation

as already i answered here: You will need to implement your own picker, using media queries (by song ,by artist, etc).

You will need to implement your own picker, using media queries (by song ,by artist, etc).

I suggest reading: “Using the iPod Library” in Apple's "iPod Library Access Programming Guide"

and more specific: MPMediaPlaylist Class Ref

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜