MPMediaPickerController with video media types not working

前端 未结 2 862
隐瞒了意图╮
隐瞒了意图╮ 2021-01-01 04:03

I am trying to browse video stored in my iPod library using the new video media types. With any video type I get this error on the console:

Warning: Unsuppo         


        
2条回答
  •  死守一世寂寞
    2021-01-01 04:08

    Can you query the Movie library in code successfully e.g.:

    MPMediaPropertyPredicate *predicate = [MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithInteger:MPMediaTypeMovie] forProperty:MPMediaItemPropertyMediaType];
    
    MPMediaQuery *query = [[MPMediaQuery alloc] init];
    [query addFilterPredicate:predicate];
    
    NSArray *items = [query items];
    
    for (MPMediaItem* item in items)
    {
        NSString* title = [item valueForProperty:MPMediaItemPropertyTitle];
    
        url = [item valueForProperty:MPMediaItemPropertyAssetURL];
    
    }
    

    You should see all movie titles. This is OK for me on IOS5 and iPad 2. I still have your problem though. A workaround is putting the above code results in its own modal view.

提交回复
热议问题