MPMediaPickerController with video media types not working

前端 未结 2 878
隐瞒了意图╮
隐瞒了意图╮ 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:13

    SWIFT 3 form @John Goodstadt

    import MediaPlayer
    
    let predicate = MPMediaPropertyPredicate(value: MPMediaType.any.rawValue, forProperty: MPMediaItemPropertyMediaType)
        let query = MPMediaQuery()
        query.addFilterPredicate(predicate)
        let items = query.items
        for item in items! {
            DLog("title: \(item.title); url: \(item.assetURL)")
        }
    

    then you can change type as you need.

提交回复
热议问题