diff --git a/README.md b/README.md index c4a87f0..1c718ee 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,25 @@ -# Cordova Music Controls Plugin +# 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. Handle also headset event (plug, unplug, headset button). +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 -- Android (4.1+) +- Android (4.1+) ([homerours](https://github.com/homerours)) - Windows (10+, by [filfat](https://github.com/filfat)) - iOS 8+ (by [0505gonzalez](https://github.com/0505gonzalez)) ## Installation -`cordova plugin add https://github.com/ghenry22/cordova-music-controls-plugin` +- Current release +`npm install cordova-plugin-music-controls2` +- Bleeding edge direct from github +`cordova plugin add https://github.com/ghenry22/cordova-plugin-music-controls2` ## Methods - Create the media controls: diff --git a/package.json b/package.json index 0a58f6c..afa1b26 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { - "name": "cordova-music-controls", - "version": "2.2.1", + "name": "cordova-plugin-music-controls2", + "version": "3.0.3", "description": "Music controls for Cordova apps", "cordova": { - "id": "cordova-music-controls", + "id": "cordova-plugin-music-controls2", "platforms": ["android", "windows", "ios"] }, "repository": { "type": "git", - "url": "git+https://github.com/yoojene/cordova-music-controls.git" + "url": "git+https://github.com/ghenry22/cordova-plugin-music-controls2.git" }, "keywords": [ "cordova", @@ -25,14 +25,14 @@ "engines": [ { "name": "cordova", - "version": ">=3.4.0" + "version": ">=4.0.0" } ], - "author": "homerours", + "author": "ghenry22", "license": "MIT", "bugs": { - "url": "https://github.com/yoojene/cordova-music-controls/issues" + "url": "https://github.com/ghenry22/cordova-plugin-music-controls2/issues" }, "homepage": - "https://github.com/yoojene/cordova-music-controls#readme" + "https://github.com/ghenry22/cordova-plugin-music-controls2#readme" } diff --git a/plugin.xml b/plugin.xml index bfbf697..af88072 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,16 +1,16 @@ - MusicControls + id="cordova-plugin-music-controls2" + version="3.0.3"> + Music Controls cordova,music,controller,controls,media,plugin,notification,lockscreen,now,playing - https://github.com/yoojene/cordova-music-controls + https://github.com/ghenry22/cordova-plugin-music-controls2 Music controls for Cordova apps MIT - HomerOurs + ghenry22 - + @@ -29,6 +29,10 @@ + + + + diff --git a/src/android/MusicControlsNotification.java b/src/android/MusicControlsNotification.java index 1500e59..2386cd5 100644 --- a/src/android/MusicControlsNotification.java +++ b/src/android/MusicControlsNotification.java @@ -47,9 +47,9 @@ public MusicControlsNotification(Activity cordovaActivity,int id){ // use channelid for Oreo and higher if (Build.VERSION.SDK_INT >= 26) { // The user-visible name of the channel. - CharSequence name = "cordova-music-controls-plugin"; + CharSequence name = "Audio Controls"; // The user-visible description of the channel. - String description = "cordova-music-controls-plugin notification"; + String description = "Control Playing Audio"; int importance = NotificationManager.IMPORTANCE_LOW; diff --git a/src/android/MusicControlsNotificationKiller.java b/src/android/MusicControlsNotificationKiller.java index 1db794d..6e3d76f 100644 --- a/src/android/MusicControlsNotificationKiller.java +++ b/src/android/MusicControlsNotificationKiller.java @@ -27,4 +27,11 @@ public void onCreate() { mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); mNM.cancel(NOTIFICATION_ID); } + + @Override + public void onDestroy() { + mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); + mNM.cancel(NOTIFICATION_ID); + } + }