Renderer
This page contains all the required documentation for the Renderer and its functions/events.
PluginEnv
When plugins are loaded in Cider the constructor()
in the plugin class is passed a PluginEnv
object, this object contains:
win
- The renderer window
dir
- Path to the plugin directory
dirName
- Plugin directory name
Loading frontend plugin(s)
To load a front end plugin (typically named index.frontend.js
) from index.js
PluginEnv.utils.loadJSFrontend(path: string)
is used.
Example: PluginEnv.utils.loadJSFrontend(path.join(PluginEnv.dir, "index.frontend.js"))
utils
getPath(path: string)
- Returns path used by Cider by name.
rendererPath
- renderer/ folder
resourcePath
- resources/ path
ciderCache
- Cider cache path
getLocale(language: string, key: string)
Fetches the i18n locale for the given language.
getStoreValue(key: string)
setStoreValue(key: string, value: any)
loadJSFrontend(path: string)
Loads a JavaScript file into the renderer, this is the main method of loading front end plugins.
playback.
- Controls playback
.playPause()
- Toggles playback
.next()
- Next track in queue
.previous()
- Previous track in queue
Built in events
Cider plugins support these methods by default, however more can be made with the use of ipcMain and ipcRenderer
onReady(win)
- (Required) Executes when the back end is ready
onRendererReady()
- Executes when the renderer has finished loading (app.init())
onPlaybackStateDidChange(attributes)
- Executes when playback state changes, passes song attributes
onNowPlayingItemDidChange(attributes)
- Executes when song changes, passes song attributes
onBeforeQuit
- Executes before Cider quits
Cider Frontend API (CiderFrontAPI)
Function/Method
Usage
Details
App Functions/Methods (app.*)
Function/Method
Usage
Details
Cider Audio (CiderAudio)
Function/Method
Usage
Details