Websocket documentation

Karaoke Mugen's app sends websocket messages to client browsers to notify them of updates on the interface, or that they should query once again some API via HTTP to get updated.

Each message has a type (e.g. playerStatus) and data, either in JSON or text.

Player events


JSON message indicating the current status of the app.


  • private : (boolean) if the karaoke session is a public or private one
  • status : Engine status (play, pause or stop)
  • onTop : (boolean) is the player on top ?
  • fullscreen : (boolean) is the player fullscreen ?
  • timePosition : (real) Position in seconds the player is at in the currently playing song
  • duration : (integer) Total duration of the song in seconds
  • muteStatus : (boolean) is the player muted?
  • playerStatus : Player status (play, pause or stop). It can be different from the engine status on specific cases
  • currentlyPlaying : (integer) kara_id of the song currently playing. -1 if it's a jingle.
  • subText : When available, lyrics being displayed on screen are rendered here.
  • volume : (integer) Volume from 0 to 100.


    private: true,
    status: 'play',
    onTop: true,
    fullscreen: false,
    timePosition: 12.628,
    duration: 92,
    muteStatus: false,
    playerStatus: 'play',
    currentlyPlaying: 232,
    showSubs: true,
    volume: 100,

Poll events


Event sent when a song poll is finished so you can display who won and with how many votes


JSON object :

  • votes : (integer) Number of votes needed to win
  • kara : Name of song which won


    votes: 5,
    kara: 'Mahoromatic - AMV - Dernière Danse 2010'


This message is sent if the poll system has been disabled. It has no data.


This message is sent when a new poll has been started. It contains JSON data similar to a playlist contents from the API call GET /public/playlists/current/karas for example, or from the GET /public/songpoll call.

Playlists events


Event sent when the list of playlists has been updated (creation/deletion/name change). It contains no data, and should trigger a refresh of the playlists list.s


Event sent when a playlist information has been updated. Data is the playlist ID number. When received, it should trigger a refresh of that playlist status/list of playlists


Event sent when a playlist has been modified. Data is the playlist ID number. When received, it should trigger a refresh of the playlist contents, if it is being displayed on screen.


Event sent when the blacklist has been updated by an admin. You should refresh the main karas list as some songs might now be hidden/visible to the user. The blacklist contents should also be refreshed.


See above.

User events


Event sent when the list of users has been updated (new user...) It contains no data.


A specific user has been updated. Data is the user ID number.


Contains a message sent by the admin, to be displayed on the user's screen. Data is the message in question.


A user's favorites has been updated. Data is the user's login name.


The number of songs/seconds a user has left has been updated. Data contains JSON with the properties according to the below example. Check out the configuration to learn more about user quotas.


{ username: 'Axel', quotaLeft: 5, quotaType: 1 }