https://github.com/jeancsanchez/jcplayer
:musical_note: A simple audio player for Android applications.
https://github.com/jeancsanchez/jcplayer
android audio audio-player gradle-dependency java kotlin library media player players playlist radio songs
Last synced: 6 months ago
JSON representation
:musical_note: A simple audio player for Android applications.
- Host: GitHub
- URL: https://github.com/jeancsanchez/jcplayer
- Owner: jeancsanchez
- License: apache-2.0
- Created: 2016-08-02T12:20:10.000Z (about 9 years ago)
- Default Branch: master_v2
- Last Pushed: 2022-08-30T15:22:26.000Z (about 3 years ago)
- Last Synced: 2025-04-09T06:12:23.991Z (6 months ago)
- Topics: android, audio, audio-player, gradle-dependency, java, kotlin, library, media, player, players, playlist, radio, songs
- Language: Kotlin
- Homepage:
- Size: 3.72 MB
- Stars: 269
- Watchers: 8
- Forks: 110
- Open Issues: 41
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://jitpack.io/#jeancsanchez/JcPlayer)
![]()
A simple audio player for Android that you can plugin to your apps quickly get audio playback working.

## New features
- Raw files
- Asset Files
- Custom layout## Tested files
- http://xxxx/abc.mp3## Not tested URLs
- http://xxxx/abc.m4a
- http://xxxx:1232
- http://xxxx/abc.pls
- http://xxxx/abc.ram
- http://xxxx/abc.wax
- rtmp://xxxx
- http://xxxx/abc.aspx
- http://xxxx/abc.php
- http://xxxx/abc.html
- mms://xxxx## Support us
You can support us by becoming a patron on Patreon, any support is much appreciated.
[](https://www.patreon.com/jeancsanchez)
## Gradle Dependency (Project level)
```Gradle
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
```
## Gradle Dependency (Module level)
```Gradle
dependencies {
// ... other dependencies
implementation 'com.github.jeancsanchez:JcPlayer:{version}'
}
```## Getting Started
You only need a JcPlayerView on your Layout Activity/Fragment. All the controls and everything else are created by the player view itself.
```xml```
## Code Setup
#### Find your JcPlayerView xml and...
```java
jcplayerView = (JcPlayerView) findViewById(R.id.jcplayerView);
```### Option 1: Just init a playlist
```java
ArrayList jcAudios = new ArrayList<>();
jcAudios.add(JcAudio.createFromURL("url audio","http://xxx/audio.mp3"));
jcAudios.add(JcAudio.createFromAssets("Asset audio", "audio.mp3"));
jcAudios.add(JcAudio.createFromRaw("Raw audio", R.raw.audio));jcplayerView.initPlaylist(jcAudios, null);
```### Option 2: Initialize an anonymous playlist with a default title for all
```java
jcplayerView.initAnonPlaylist(jcAudios);
```### Option 3: Initialize an playlist with a custom title for all
```java
jcplayerView.initWithTitlePlaylist(urls, "Awesome music");
```### Call the notification player where you want.
```java
jcplayerView.createNotification(); // default icon
```
OR
```java
jcplayerView.createNotification(R.drawable.myIcon); // Your icon resource
```### How can I get callbacks of player status?
```java
MyActivity implements JcPlayerManagerListener {
....
jcplayerView.setJcPlayerManagerListener(this);
// Just be happy :D
}
```## Custom layout
You can customize the player layout by manipulating these attributes.
```xml
app:next_icon
app:next_icon_color
app:pause_icon
app:pause_icon_color
app:play_icon
app:play_icon_color
app:previous_icon
app:previous_icon_color
app:progress_color
app:random_icon_color
app:repeat_icon
app:repeat_icon_color
app:seek_bar_color
app:text_audio_current_duration_color
app:text_audio_duration_color
app:text_audio_title_color
```
### Please, if you liked this project or help you to do your job, support me by being a sponsor <3## TODO LIST ##
* [x] Set custom layouts for player.
* [ ] Add Instrumentation tests
* [ ] Add unit tests.