获取所有音频& ios中的视频文件 [英] Fetch All Audio & Video files in ios

查看:178
本文介绍了获取所有音频& ios中的视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将所有音频文件以及设备中的视频文件提取到应用中。这样我就可以将他们的名字列入不同的UITableViews。在ios中是否有任何方法,以便我可以获取它们。

I want to fetch all audio files and also video files from device into the app. so that i can listed their names into the different UITableViews. Is there any way in ios, so that i can fetch them.

推荐答案

看看这个,特别是以编程方式获取媒体项目部分。

如果媒体项目选择器未提供您想要的控件,您可以使用此API中的数据库访问类。这些类旨在让您创建任意复杂的查询。例如,您可以检索标题包含特定单词或短语的特定类型的所有歌曲。

If the media item picker doesn’t provide the control you want, you can use the database access classes from this API. These classes are designed to let you create arbitrarily complex queries. You could, for example, retrieve all the songs in a particular genre whose titles include a particular word or phrase.

使用程序化访问是一个两步过程:

配置查询。请求查询检索其匹配的媒体项。媒体查询是对从设备iPod库检索的内容以及应如何排列这些检索到的项目的描述。它有两个要配置的属性:

Configure a query. Ask the query to retrieve its matching media items. A media query is a description of what to retrieve from the device iPod library and how those retrieved items should be arranged. It has two properties to configure:

过滤器是要检索的内容的描述。过滤器是可选的;无过滤查询与整个iPod库匹配。分组类型是可选键,指定用于检索的媒体项集合的排列。进一步缩放,过滤器可以像您的应用程序一样简单或复杂。它由媒体属性谓词的一个或多个实例组成。媒体属性谓词是用于测试每个媒体项的逻辑条件的语句。调用查询时,将从iPod库中检索满足过滤器的项目。

The filter is the description of what to retrieve. The filter is optional; a filterless query matches the entire iPod library. The grouping type is an optional key that specifies the arrangement to use for retrieved collections of media items. Zooming in a bit more, the filter can be as simple or complex as your application demands. It consists of one or more instances of a media property predicate. A media property predicate is a statement of a logical condition to test each media item against. The items that satisfy the filter are retrieved from the iPod library when you invoke the query.

可选的分组类型指定集合的​​排列和排序以及每个集合中的媒体项目的排序。例如,使用专辑分组类型会导致按照专辑分组的返回媒体项目,每个专辑的歌曲按跟踪顺序排序。

The optional grouping type specifies the arrangement and sorting of collections as well as the sorting of media items within each collection. For example, using an "album" grouping type results in returned media items grouped by album, with each album’s songs sorted in track order.

如需更多帮助,请查看以下链接:

For more help,check these links :

检索按iOS上次播放时间排序的歌曲列表

如何获取所有歌曲的列表数组中的ipodLibrary

Iphone:如何显示应用程序内库中的歌曲列表

http://mobisoftinfotech.com/integrate-music-player-in-iphone/

这篇关于获取所有音频& ios中的视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆