JcPlayer


Source link: https://github.com/jeancsanchez/JcPlayer

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
  • Local files

Tested files

Not tested URLs

Maven

allprojects {

  repositories {

jcenter()

maven {

 url  "http://dl.bintray.com/jeancsanchez/maven"

}

  
}
 
}

Gradle Dependency

dependencies {

  // ... other dependencies
  compile 'io.github.jeancsanchez.jcplayer: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.

<com.example.jean.jcplayer.JcPlayerView
  android:id="@+id/jcplayer"
  android:layout_width="match_parent"
  android:layout_height="match_parent"/>

Code Setup

Find your JcPlayerView xml and...

 jcplayerView = (JcPlayerView) findViewById(R.id.jcplayerView);

Option 1: Just init a playlist

 ArrayList<JcAudio> 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);

Option 2: Initialize an anonymous playlist with a default title for all

 jcplayerView.initAnonPlaylist(jcAudios);

Option 3: Initialize an playlist with a custom title for all

 jcplayerView.initWithTitlePlaylist(urls, "Awesome music");

Call the notification player where you want.

 jcplayerView.createNotification();
 // default icon

OR

 jcplayerView.createNotification(R.drawable.myIcon);
 // Your icon resource

How can I get callbacks of player status?

 MyActivity implements JcPlayerService.JcPlayerServiceListener {

....

jcplayerView.registerServiceListener(this);

// Just be happy :D  
}

How to contribute

Follow this guidelines, specially the commits style guide:
https://github.com/jeancsanchez/Android-Guidelines-and-Architecture/blob/master/code_guidelines.md

Note

The list view is developer responsibilty

TODO LIST

  • Set custom layouts for player.
  • Add Instrumentation tests
  • Add unity tests.

Resources

This is a library which allows you to create a record button view in android.

Custom slider for Android build from scratch.

A helper class for Toolbar configuration.

Convalida is a simple, lightweight and powerful field validation library for Android.

This is a vertical seekbar like in the IOS 11 control center with an image at the bottom.

This is an Android library for cropping images. Move images smoothly, and crop images precisely.

Enjoy cropping!

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes