mpmediaquery

Cryptic SQLite console output in Objective-C

本秂侑毒 提交于 2020-01-16 14:39:06
问题 When running my program to query the iPod library of my iPhone, I get the following output in the console: CPSqliteStatementPerform: attempt to write a readonly database for UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified FROM container WHERE pid=container_pid) WHERE orig_date_modified=0 I have disabled everything that outputs to the console so it isn't as if I am having an error with NSLog. What is going on here and how can I fix it. I'll include the overall class

Why CSS Media Query doesn't work on mobile device but yes on Google Chrome device emulator?

南笙酒味 提交于 2020-01-06 02:30:15
问题 As from the title, I don't understand why the media query works on emulator device on Google Chrome and it doesn't work on a real mobile device. Html meta tag <meta name="viewport" content="width=max-width, initial-scale=1, maximum-scale=1, user-scalable=no"> Css: @media screen and (min-device-width:640px) and (max-device-width:767px){...} Actually I've set up the min and max resolutions from 640/768/850/1024 for mobile devices screen resolution, but it seems be an error, cause .... I don't

iOS - get programmatically queue of items currently playing

我与影子孤独终老i 提交于 2020-01-02 01:11:09
问题 I want to get programmatically queue currently played in native Music App. I can use MPMusicPlayerController to get currently playing item but I want to get not only the item but whole playing queue. Is it possible to do it using AVFoundation or any other library? 回答1: I'm afraid this is not possible. Apple does not give us access to this information from any libraries. 回答2: I'm pretty sure this is not possible through any public API. The Ecoute app that @sooper mentions must be using private

cannot subscript a value of type [MPMediaItem]

送分小仙女□ 提交于 2019-12-24 15:20:05
问题 I am trying to execute this code in order to get all the music playlists that the users can have on their phones. var queryPlaylists = MPMediaQuery.playlistsQuery() print(queryPlaylists.collections[0]) However, when I try to access any of the elements of queryPlaylists.collections I get a compilation error: Cannot subscript a value of type [MPMediaItem]. This does not make any sense to me since the above in an array. In addition this used to work before xcode 7.0. 回答1: I figured out in order

Problems with MPMediaQuery and iTunes Match

ε祈祈猫儿з 提交于 2019-12-23 00:30:48
问题 I need to display a list of all of the playlists currently on the device. The problem is, on a device with iTunes Match turned on, any number of playlists could have zero items saved on the phone. Since (as far as I can tell) there's no reliable way to trigger an MPMediaItem download when you're using AVAudioPlayer , I'd like to filter out any playlists that don't have any local entries. Right now I can have it cycle through an individual playlist and strip songs that don't have an assetURL ,

Problems with MPMediaQuery and iTunes Match

社会主义新天地 提交于 2019-12-23 00:29:02
问题 I need to display a list of all of the playlists currently on the device. The problem is, on a device with iTunes Match turned on, any number of playlists could have zero items saved on the phone. Since (as far as I can tell) there's no reliable way to trigger an MPMediaItem download when you're using AVAudioPlayer , I'd like to filter out any playlists that don't have any local entries. Right now I can have it cycle through an individual playlist and strip songs that don't have an assetURL ,

How to get the MPMediaItem (audiobook) individual chapters

烂漫一生 提交于 2019-12-22 18:27:11
问题 I know I can get all the audiobooks from the iPod library with: MPMediaPropertyPredicate *abPredicate = [MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithInt:MPMediaTypeAudioBook] forProperty:MPMediaItemPropertyMediaType]; MPMediaQuery *abQuery = [[MPMediaQuery alloc] init]; [abQuery addFilterPredicate:abPredicate]; [abQuery setGroupingType:MPMediaGroupingAlbum]; NSArray *books = [abQuery collections]; And I can get the parts/files for each book by using this: [book items];