chyroc / netease-music-controller

Control NeteaseMusic Play/Pause/Next/etc...
Apache License 2.0
9 stars 1 forks source link

netease-music-controller

Install

npm i --save @chyroc/netease-music-controller

Usage

import NeteaseMusicController from "@chyroc/netease-music-controller"

const example = async () => {
  // play
  await NeteaseMusicController.play()

  // pause
  await NeteaseMusicController.pause()

  // next
  await NeteaseMusicController.nextTrack()

  // previous
  await NeteaseMusicController.previousTrack()

  // up volume
  await NeteaseMusicController.turnUpVolume()

  // down volume
  await NeteaseMusicController.turnDownVolume()

  // like
  await NeteaseMusicController.likeTrack()

  // dislike
  await NeteaseMusicController.dislikeTrack()

  // toggle lyrics
  await NeteaseMusicController.toggleLyrics()

  // exit
  await NeteaseMusicController.exit()
}