Hello, in my app I want to be able to play audio files directly from Dropbox. I have already successfully connected the Dropbox API. I can get a list of user files and download them.
What other settings should I make to play audio files? What url should I use for this?
For download I use .pathLower of file, but it isn't a URL...
Yes, of course. That's why I told you construct it yourself! The SDK, you are using, constructs it, but you don't have direct access there. It's only for internal use (don't ask me why).
... How can I create the URL for streaming?
Did you read the link in my previous post?
... But I don't understand what is the "--header". It's a header of the HTTP request? ...
Seems you haven't used terminal shell yet. The example, which confuses you, is a just a example of call a Dropbox HTTP API using a Posix's command ( more precisely 'curl' ). This is NOT a URL itself! Yes, it's strange, Dropbox hasn't provided a pure HTTP example too, but it's Dropbox, what can I say. In the particular example curl takes care for URL construction and the call invocation. It's supposed every developer have basic knowledge about what's a URL and all components. The URL is nothing more than provided in the "URL STRUCTURE" field:
Here the set of parameters is empty, so you don't have to pass anything. What exactly has to be downloaded and from where (i.e. the account) gets denoted with headers (i.e. what follows the "--header"). Last, but not least, the request must be POST. For more info how this could be achieved using Swift take a look here.
Hope this gives enough directions.
Thanks a lot. What other ways are there to solve my question? How about getTemporaryLink function? Can I use it for streaming audio? I found this solution here: https/stackoverflow.com/questions/39247178/how-to-play-dropbox-audio-file-using-jukebox-using-swift
Yes, using a link is a possible way. I didn't mention it, as I'm guess You already have rejected such a possibility. It is more convenient and easy to implement, but have some disadvantages. Less secure and limited traffic (could be banned). If this is not a problem, Yes, of course.
The choice is yours!
The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.Sound good? Let's get started.
For more info on available support options, see this article.
If you found the answer to your question, please 'like' the post to say thanks to the user!