【问题标题】:How to stream mp3 file directly from Dropbox using dropbox api in android如何在 android 中使用 dropbox api 直接从 Dropbox 流式传输 mp3 文件
【发布时间】:2016-04-04 16:35:51
【问题描述】:

我想将 mp3 文件直接从 Dropbox 流式传输到我的 Android 应用程序。我正在使用 Dropbox Core Api 和 MediaPlayer 播放音频。但 MediaPlayer 接受 URL 或文件。从 Dropbox 代码 api 我得到 InputStream 和 Shared URL。我尝试使用共享 URL 但无法正常工作。共享网址如下所示:https://db.tt/117aYGdu 和第二个选项是 Dropbox 中的 InputStream 有一个方法 mApi.getFileStream(path, rev) 返回文件的输入流。但是如何将它与 android MediaPlayer 一起使用。

【问题讨论】:

  • 你一定是在用/shares api,你为什么不用/media?

标签: java android


【解决方案1】:

在 Drivebox Core API Reference 中搜索了很多之后,我喜欢一种方法调用媒体

DropboxLink dropboxMediaLink = mApi.media(path, false);

这里的路径是你的 entry.path 和 ssl 在这里我设置为 false。

【讨论】:

    猜你喜欢
    • 2017-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-05
    • 1970-01-01
    • 2016-03-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多