-
-
Save booploops/b63be94c490a572fdce6cdad9edceffd to your computer and use it in GitHub Desktop.
AME Plugin Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @name Example Plugin | |
* @author Your Name Here | |
* @description My plugin's description | |
*/ | |
/** | |
* Using this helper class is optional, it includes functions and event handlers to save some time and for future proofing your plugin. | |
* | |
* You can use as much or as little of the AMEPluginHelper class as you want for your plugin. | |
* | |
* For more information on plugin development refer to: https://github.com/Apple-Music-Electron/Apple-Music-Electron/wiki/Plugins#development | |
*/ | |
class ExamplePlugin extends AMEPluginHelper { | |
Start() { | |
// Code here will execute once the web player and AME have finished loading. | |
// Give your plugin a name so it can announce itself. | |
this.name = "Example Plugin" | |
// This will add a menu option under the profile menu | |
this.AddMenuItem({ | |
Text: "Hello world!", // Your text here | |
OnClick: (event)=>{ // Your clicked event here | |
alert("Hello world clicked!") | |
} | |
}) | |
} | |
OnPlaybackStateChanged(args = {Attributes: null}) { | |
// When the playback state changes (play/pause) | |
console.log(args["Attributes"]) | |
} | |
} | |
/** Change this to your new plugin class name */ | |
new ExamplePlugin() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment