android - 具有自己的 JSON 和 Youtube 音频库的通用音乐播放器

标签 android json youtube audio-player android-music-player

如这一行所述:

private static final String CATALOG_URL =
"http://storage.googleapis.com/automotive-media/music.json";

此文件包含由 Google 在线托管的轨道列表

所以,我想 Jazz_In_Paris.mp3 的完整 URL 应该是

https://www.youtube.com/audiolibrary/music/Jazz_In_Paris.mp3

但以我尝试过的相同方式得到 404 Not Found

https://www.youtube.com/audiolibrary/music/album_art.jpg

但同样的结果 404 Not Found

下面是我的几个小问题:

1. What is the complete URL of `Jazz_In_Paris.mp3` and `album_art.jpg`

2. Where they have used site object "site" : "https://www.youtube.com/audiolibrary/music" in application (in which class and where)

3. Where I have to make changes in my code, If I would like to get JSON from my own Server "http://www.domain.com/services/music.json"

4. How can I create my own Youtube Audio Library, Like in my Library I would like to add my favourite youtube songs

最佳答案

Jazz_In_Paris.mp3album_art.jpg 的完整 URL 是什么?

http://storage.googleapis.com/automotive-media/album_art.jpg

http://storage.googleapis.com/automotive-media/The_Messenger.mp3


他们在哪里使用站点对象“site”:“https://www.youtube.com/audiolibrary/music”在应用程序中(在哪个类和哪里)

此网址未在应用程序中的任何地方使用。


如果我想从我自己的服务器“http://www.domain.com/services/music.json”中获取 JSON,我必须在我的代码中进行更改

是的,您可以为您的应用程序使用相同的 json,但只需更改服务器的路径(只需创建相同的 json 格式)


如何创建自己的 Youtube 音频库,就像在我的库中一样,我想添加我最喜欢的 youtube 歌曲

Universal Music Player:使用 Google 存储客户端存储音乐文件,但您也可以创建自己的 youtube channel 并制作私有(private)视频。在您的应用中使用它


已编辑:

“站点”json 对象是无用的。这个对象是 json,因为他们使用过以前版本的应用程序。目前没有。

youtube channel Google 存储 都是不同的东西。 Google 存储主要用于存储我们可以在我们的应用中使用的文件。

在你的管中,每个人都可以上传私有(private)/公共(public)视频(如果你打算在你的应用程序中使用它,那么使用私有(private))。有关更多详细信息,请查看您的支持 articals

我建议你使用Google Storage API或者你也可以在你自己的服务器上上传文件!

关于android - 具有自己的 JSON 和 Youtube 音频库的通用音乐播放器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34553822/

相关文章:

python - Python 3.8 上的 Youtube 搜索

android - 应用程序中的监听器和切换 Activity

android - 如何使警报对话框填充 90% 的屏幕尺寸?

android - 当 launchMode ="singleTask"重新打开 Activity 时,返回堆栈会发生什么情况?

json - Swift NSMutableDictionary 解析 json 失败

php - json_encode 不会编码超过 6670 行

ios - iOS YouTube API v3:上传的视频网址

.htaccess - 在htaccess模式下使用问号重写

java - 将捕获的图像从 Camera2 Api 传递到另一个 Activity

javascript - 如何解析json中的特殊字符?