We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
celinafregoso99
5 years agoExplorer | Level 3
why I can't stream an audio stored in dropbox using Android Exoplayer?
I can use an exoplayer like this
lateinit var player : SimpleExoPlayer!
val mediaItem = MediaItem.fromUri("https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3")
player = SimpleExoPlayer.Builder(mContext).build()
player.setMediaItem(mediaItem)
playerView.player = player
I can stream the audio without any use if I use the code above.
but if I want to use an audio file that have in dropbox, the sound will never play, the code and link is like this
val mediaItem = MediaItem.fromUri("https://www.dropbox.com/s/lbe1kod9t6yuh5j/sample1.m4a")
how to solve this ?
2 Replies
- Greg-DB5 years ago
Dropbox Community Moderator
[Cross-linking for reference: https://stackoverflow.com/questions/64764134/why-i-cant-stream-an-audio-stored-in-dropbox-using-android-exoplayer ]
It looks like you already have an accepted answer on StackOverflow, but let us know if there's still anything we can help with.
- Здравко5 years agoLegendary | Level 20
celinafregoso99 wrote:...
val mediaItem = MediaItem.fromUri("https://www.dropbox.com/s/lbe1kod9t6yuh5j/sample1.m4a")
how to solve this ?
You're not pointing media file but a preview page (i.e. HTML)! One alternative is download link:
val mediaItem = MediaItem.fromUri("https://www.dropbox.com/s/lbe1kod9t6yuh5j/sample1.m4a?dl=1")
Or might be better raw shared link:
val mediaItem = MediaItem.fromUri("https://www.dropbox.com/s/lbe1kod9t6yuh5j/sample1.m4a?raw=1")
Good luck!
About Discuss Dropbox Developer & API
Make connections with other developers814 PostsLatest Activity: 2 years ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!