{"size": 732, "ext": "js", "max_stars_repo_path": "src/inject/features/playback_api/control.js", "max_stars_repo_name": "maikka39/Youtube-Music-Desktop-Player", "max_stars_repo_stars_event_min_datetime": "2019-10-08T11:38:09.000Z", "max_stars_repo_stars_event_max_datetime": "2019-10-13T08:39:29.000Z", "max_issues_repo_path": "src/inject/features/playback_api/control.js", "max_issues_repo_name": "maikka39/Youtube-Music-Desktop-Player", "max_issues_repo_issues_event_min_datetime": "2021-01-28T20:18:31.000Z", "max_issues_repo_issues_event_max_datetime": "2021-01-28T20:18:31.000Z", "max_forks_repo_path": "src/inject/features/playback_api/control.js", "max_forks_repo_name": "maikka39/Youtube-Music-Desktop-Player", "max_forks_repo_forks_event_min_datetime": "2020-01-18T19:25:08.000Z", "max_forks_repo_forks_event_max_datetime": "2020-01-18T19:25:08.000Z"}
{"max_stars_count": 3, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 14.64, "max_line_length": 49, "alphanum_fraction": 0.6734972678}
/* eslint-disable no-undef */
function toggle () {
  if (player.playerApi_.getPlayerState() === 1) {
    pause()
    return
  }

  play()
}

function play () {
  player.playerApi_.playVideo()
}

function pause () {
  player.playerApi_.pauseVideo()
}

function next () {
  player.playerApi_.nextVideo()
}

function previous () {
  player.playerApi_.previousVideo()
}

function seek (time) {
  player.playerApi_.seekTo(time)
}

function seekBy (time) {
  player.playerApi_.seekBy(time)
}

function setVolume (volume) {
  player.playerApi_.setVolume(volume)
}

module.exports = {
  toggle: toggle,
  play: play,
  pause: pause,
  next: next,
  skip: next,
  previous: previous,
  seek: seek,
  seekBy: seekBy,
  setVolume: setVolume
}
