我试图让谷歌选择器让用户只选择 mp3 文件。我查看了 Picker 的文档,但没有看到任何关于 Mp3 文件的 ViewID 应该是什么的信息。此外,尝试显示所有文件addView(google.picker.ViewId.DOCS).也不起作用。有人知道如何只加载 .mp3 或所有文件吗?谢谢!
1 回答
1
据我测试,没有“仅加载 mp3 文件”,但有“加载包括 mp3 的所有文件”。
只需按照Picker API 快速入门代码并更改这些部分:
从
var scope = 'https://www.googleapis.com/auth/photos'
至
var scope = 'https://www.googleapis.com/auth/drive';
(在 createPicker().. 中)来自
addView(google.picker.ViewId.PHOTOS).
至
addView(google.picker.ViewId.DOCS).
and then when the picker selector appears, you can type .mp3 and in the search box and it'll show all the mp3 files.
于 2018-08-03T08:52:46.103 回答
