From fca0875c1a45fe9afa30637e6408420027eed47d Mon Sep 17 00:00:00 2001 From: ghenry22 Date: Wed, 12 Feb 2020 09:53:39 +0800 Subject: [PATCH 1/6] update package name ready to publish --- package.json | 16 ++++++++-------- plugin.xml | 16 ++++++++++------ src/android/MusicControlsNotificationKiller.java | 7 +++++++ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 0a58f6c..7f9df8b 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { - "name": "cordova-music-controls", - "version": "2.2.1", + "name": "cordova-plugic-music-controls2", + "version": "3.0.0", "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..db48d09 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,16 +1,16 @@ - MusicControls + id="cordova-plugin-music-controls2" + version="3.0.0"> + 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/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); + } + } From 34d343f844bffab655f9715d5c405a67bbf2695d Mon Sep 17 00:00:00 2001 From: ghenry22 Date: Wed, 12 Feb 2020 10:02:03 +0800 Subject: [PATCH 2/6] update readme --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c4a87f0..2e31864 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,24 @@ -# 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 +- Current release +`npm install cordova-plugin-music-controls2` +- Bleeding edge direct from github `cordova plugin add https://github.com/ghenry22/cordova-music-controls-plugin` ## Methods From 7e33aba2e7458a7690a90165d929b49be9225d05 Mon Sep 17 00:00:00 2001 From: ghenry22 Date: Wed, 12 Feb 2020 10:03:38 +0800 Subject: [PATCH 3/6] update repo names --- README.md | 2 +- package.json | 2 +- plugin.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2e31864..1c718ee 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ updates to npm to make life easier for everyone. - Current release `npm install cordova-plugin-music-controls2` - Bleeding edge direct from github -`cordova plugin add https://github.com/ghenry22/cordova-music-controls-plugin` +`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 7f9df8b..34eebc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugic-music-controls2", - "version": "3.0.0", + "version": "3.0.1", "description": "Music controls for Cordova apps", "cordova": { "id": "cordova-plugin-music-controls2", diff --git a/plugin.xml b/plugin.xml index db48d09..f61151e 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="3.0.1"> Music Controls cordova,music,controller,controls,media,plugin,notification,lockscreen,now,playing https://github.com/ghenry22/cordova-plugin-music-controls2 From 646a4d25982207f6654bd12c2f260a5d6a96f1b4 Mon Sep 17 00:00:00 2001 From: ghenry22 Date: Wed, 12 Feb 2020 10:23:31 +0800 Subject: [PATCH 4/6] fix type-o in packlage name --- package.json | 4 ++-- plugin.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 34eebc1..e406607 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "cordova-plugic-music-controls2", - "version": "3.0.1", + "name": "cordova-plugin-music-controls2", + "version": "3.0.2", "description": "Music controls for Cordova apps", "cordova": { "id": "cordova-plugin-music-controls2", diff --git a/plugin.xml b/plugin.xml index f61151e..2ba09c7 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="3.0.2"> Music Controls cordova,music,controller,controls,media,plugin,notification,lockscreen,now,playing https://github.com/ghenry22/cordova-plugin-music-controls2 From 9d6142b87c2669da561aaaf5a11566c82b200cba Mon Sep 17 00:00:00 2001 From: ghenry22 Date: Wed, 12 Feb 2020 10:30:10 +0800 Subject: [PATCH 5/6] better channel name and description --- src/android/MusicControlsNotification.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; From 285a894b588dae89fec8e30ef16553147051fc20 Mon Sep 17 00:00:00 2001 From: ghenry22 Date: Wed, 12 Feb 2020 10:33:49 +0800 Subject: [PATCH 6/6] v3.0.3 --- package.json | 2 +- plugin.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e406607..afa1b26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-music-controls2", - "version": "3.0.2", + "version": "3.0.3", "description": "Music controls for Cordova apps", "cordova": { "id": "cordova-plugin-music-controls2", diff --git a/plugin.xml b/plugin.xml index 2ba09c7..af88072 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="3.0.3"> Music Controls cordova,music,controller,controls,media,plugin,notification,lockscreen,now,playing https://github.com/ghenry22/cordova-plugin-music-controls2