npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-applemusic

v1.3.3

Published

Cordova Apple Music

Downloads

61

Readme

CordovaAppleMusic

Access Apple Music from Cordova. This plugin was built to extend zwand19's plugin, and provides other features that the original plugin does not have. Please feel free to ask me any questions you may have.

Installation

cordova plugin add cordova-plugin-applemusic

Usage

appleMusic.init((data) => {
      console.log("Plugin Initialized")
    }, (err) => {
      console.log("Error Initializing Plugin")
    })

Initialize the plugin

appleMusic.init(successFunction, failureFunction)  

Request Authorization

appleMusic.requestAuthorization(function(isAuthorized){}, failureFunction) 

Get Play Lists

  appleMusic.getPlayLists(function(playLists){}, failureFunction) 

Return: playLists is an array with each index containing id, name fields;

Get Songs

appleMusic.getSongs(playListId, function(songList){}, failureFunction) 

Return: songList is an array with each index containing id, name fields;

Create Play List with Songs

appleMusic.createPlayList(playListName, trackIds, function(status){}, failureFunction) 

return: status success on play list creation.

Add Single Song to Playlist

appleMusic.addSongstoPlayList(playListId, trackId,  function(status){}, failureFunction) 

Return: status success on song addition. Arguments: Playlist id, array of track ids

Player

Play a Track

appleMusicPlugin.playTrack(trackId, successFunction, failureFunction)

Queues a track by id.

Example id: itunes.apple.com/fr/album/unstoppable/id984653860?i=984653861

The following methods will allow you to manipulate the currently playing track.

Get Current Track Duration

appleMusicPlugin.getDuration(successFunction, failureFunction)

Returns the current track's duration (in seconds)

Get Current Track Position

appleMusicPlugin.getPosition(successFunction, failureFunction)

Returns the current track's position (in seconds)

Other Methods

appleMusicPlugin.pause(successFunction, failureFunction)

appleMusicPlugin.resume(successFunction, failureFunction)

appleMusicPlugin.seek(seconds, successFunction, failureFunction)

appleMusicPlugin.stop(successFunction, failureFunction)

EVENTS

The following methods will allow you to set up event handlers for the apple music player.

Track stopped playing

appleMusicPlugin.onStop(callback)

Called whenever an apple music track is stopped, interrupted, or paused.

Track seeked

appleMusicPlugin.onSeek(callback)

Called when the user seeks a new position within a track

Track started playing

appleMusicPlugin.onPlay(callback)

Called whenever an apple music track starts playing