android / uamp

A sample audio app for Android
Apache License 2.0
13.11k stars 3.75k forks source link

Play Media by Custom URI #414

Closed herbertvonkaramalz closed 3 years ago

herbertvonkaramalz commented 3 years ago

How am i able to stream for example an mp3-Stream from an Radio-Station in the UAMP-App? The Source-Code doesnt show anything which could help me...

My aim is to play a simple https://example.com/test.mp3-File which will be played.

Either where are the Media-Files comming from in the Example-App?

nic0lette commented 3 years ago

The music included in UAMP is fetched from a Uri specified in MusicService, which points to https://storage.googleapis.com/uamp/catalog.json by default.

If you wanted to make a new JSON file (that has the same format) and host that along with the music, you could change the list to be whatever songs/content you'd like.

herbertvonkaramalz commented 3 years ago

@nic0lette and this would also Work with Audio-Streams from Radio-Channels?

nic0lette commented 3 years ago

@nic0lette and this would also Work with Audio-Streams from Radio-Channels?

I don't know how those are encoded, but if ExoPlayer supports the format, then that should work.

herbertvonkaramalz commented 3 years ago

Thanks @nic0lette it works now. But only with Streams using the .mp3-Ending. Cheers!

Xaninho commented 3 years ago

Hi @herbertvonkaramalz ! I'm currently developing the same feature and I'm having trouble connecting the player to the online radio stream. If you've been successfull with this approach, could you kindly show some code or specify how you did it? The link is "http://stream.zeno.fm/nd2m6pe6yg0uv.mp3", and as you can see, the streams ends in .mp3 but the uamp returns me a "Could not locate request media". Thank you for your time!

herbertvonkaramalz commented 3 years ago

@Xaninho i have created the europaradio app here: https://github.com/herbertvonkaramalz/europaradio . I think the problem could be at the "http"... Have you tried using https?

Xaninho commented 3 years ago

@herbertvonkaramalz Hmm nah I've already tried the https link and the result is the same... I've checked this exoplayer sample: https://github.com/m-cakir/radio-player and after cloning and putting my radio there it works successfully, so I don't understand what the problem with exoplayer might be... Guess I'll work from there at the moment, but nevertheless thank you for your recommendation!

herbertvonkaramalz commented 3 years ago

@Xaninho i experienced this issue also with some streams from https://regenbogen.de... Then i've looked up for another stream from this channel and it worked. Why exactly did i never found out.