ghenry22 / cordova-plugin-music-controls2

A Cordova plugin displaying music controls in notifications (cordova-plugin-music-controls)
MIT License
59 stars 60 forks source link

Cordova Music Controls Plugin 2

Music controls for Cordova applications. Display a 'media' notification with play/pause, previous, next buttons, allowing the user to control the play. Handles headset events (plug, unplug, headset button).

This plugin is forked from the original which is no longer maintained but which can be found at: https://github.com/homerours/cordova-music-controls-plugin

This plugin is renamed as cordova-plugin-music-controls2 for easy differentiation and to allow for publishing updates to npm to make life easier for everyone.

Supported platforms

Installation

Methods

// Register callback MusicControls.subscribe(events);

// Start listening for events // The plugin will run the events function each time an event is fired MusicControls.listen();


- Toggle play/pause:
```javascript
MusicControls.updateIsPlaying(true); // toggle the play/pause notification button
MusicControls.updateDismissable(true);

List of media button events

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request