Radio station streaming example with ExoPlayer.
m-cakir / radio-player Goto Github PK
View Code? Open in Web Editor NEWAndroid radio player example with ExoPlayer
Android radio player example with ExoPlayer
radio not work and this message appear
Handler (android.os.Handler) {38681ae} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:643)
at android.os.Handler.sendMessageAtTime(Handler.java:612)
at android.os.Handler.sendMessageDelayed(Handler.java:582)
at android.os.Handler.sendMessage(Handler.java:519)
at android.os.Message.sendToTarget(Message.java:416)
at com.google.android.exoplayer2.ExoPlayerImplInternal.prepare(ExoPlayerImplInternal.java:174)
at com.google.android.exoplayer2.ExoPlayerImpl.prepare(ExoPlayerImpl.java:162)
at com.google.android.exoplayer2.ExoPlayerImpl.prepare(ExoPlayerImpl.java:130)
at com.google.android.exoplayer2.SimpleExoPlayer.prepare(SimpleExoPlayer.java:617)
at com.example.example.radio.RadioService.play(RadioService.java:393)
at com.example.example.radio.RadioService.playOrPause(RadioService.java:443)
at com.example.example.radio.RadioManager.playOrPause(RadioManager.java:40)
at com.example.example.activities.MainActivity.playTrigger_click(MainActivity.java:723)
thank you for this project ,can you please tell me how i can make it play automatically when i open the app ,i have tried to call radioManager.playOrPause();
method in onCreate
but i get this error
Attempt to invoke virtual method 'void com.mcakir.radio.player.RadioService.playOrPause()' on a null object reference
Good afternoon,
You have created very stable and efficient player. I deeply appreciate yours programmers knowledge, since you have created Java service, which enable us to use ExoPlayer as A service, this allow users to play live Internet radios even if Android device screen have been turned off. And player even work on Android 4.1.2 API 16. But I Am wondering, how complex would be to reconstruct yours player Java code so also newest stable Exoplayer library would be used. Currently, I Am getting Java bugs related to overide that some part of yours code can not be overided if I use newer Exoplayer release than The older version, which you have used. Or newest Exoplayer prevent its developers to use it as A Android service so live streams can not be play on background when Android device display have been turned off? But really, you have completed outstanding development work and thank you for .Json Android user interface support, since I could modify yours player to listen my favourite Czech radio stations. And yours code is very easy to understand even by visually impaired advanced users or developers. The amazing is, that I can use Gradlew command to build my debug .apk with no need to use Android studio. Very well done.
google play music, youtube and this app playing same time audiofocus not working.please solve this issue
not working in android 30.
Project requires Android studio 3.6, which is unavailable. Latest version is 3.4.1 for Mac.
Hi, how can i do to play more than one json ? thank
Hi
this problem appear in run time and the app crash " RuntimeException "
at android.os.Parcel.readException(Parcel.java:1472)
at android.os.Parcel.readException(Parcel.java:1426)
at com.android.internal.telephony.ITelephonyRegistry$Stub$Proxy.listen(ITelephonyRegistry.java:269)
at android.telephony.MultiSimTelephonyManager.listen(MultiSimTelephonyManager.java:184)
at com.alforat.alforat.radio.RadioService.onCreate(RadioService.java:181)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2826)
at android.app.ActivityThread.access$1900(ActivityThread.java:171)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
Hi and thanks for the example.
Making some tests with your code I try to get the strem metadata, adding the following listener at the RadioService / exoplayer
exoPlayer.addMetadataOutput(new MetadataOutput() {
@OverRide
public void onMetadata(Metadata metadata) {
Log.i("METADATA", ">>> METADATA RECEIVED" );
for (int i = 0; i < metadata.length(); i++) {
Metadata.Entry entry = metadata.get(i);
Log.i("METADATA", entry.toString() );
}
}
});
I dont get any results, but using the same code at the exoplayer demo https://github.com/google/ExoPlayer the listener returns the metadata succesfully.
Any advice?
I have one little small bug for you.
When I play 128 KB/S MP3 live stream with your included example, program automatically stop to play after 5 or 6 minutes. After several seconds, player continue to play and play even for more than 10 hours without interruption. When player stop to play, it display notification icon. So I Am thinkink, if problem is not being caused by The timer and auto refresh algorithm which show how long live stream have been listened in The notification area. This little issue is not Android version specific. How can I help to debug it and to help you repair it? Yours player is amazing and it even support my older Android 4.1.2 phone. I have tested yours player on The latest Android 8.0 from February and it play, but this little problem also exist in Android 8.
Not works in SDK 30.. please update
this project working fine in multi radio list view
i want to use this project for my single radio app. how to remove list view
Helllo
Could you help me upgrade ExoPlayer for support HLS and parse external JSON by url?
Thanks.
SouthCastPlayer.RadioService not propely bind
plz let me know how to fix it this issue.
SouthCastPlayer.RadioService.isPlaying()' on a null object reference
hello is it possible to have buttons with links rather than having a list
When users play an audio for the first time it works perfectly but when users closes the app from background while playing the audio.The audio stops but when user open the app again and try to play it doesn't play.
Device:- OnePlus 5T.
Guys any way to make it open .pls links and load list from remote json ? , i think some AssynkTask should be written for that , though the open of .pls links might be a bit complicated .
No headset control bluetooth control not playing background
it only work screen lock control.. all other controls not work
Nice implementation.
It must have a basic playback functionalities -
(1) It should work like a Playlist
1.1. If first song is over, then it should start second automatically and so on
1.2. Keep controls at bottom (to move next and previous) where you using play/pause
Source code not working in sdk 28, it always crash when click on list of channel after upgrade in sdk 28... @m-cakir
Can you tell me how to make an image next to the names of radios
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.