Page 1 of 1

Update for beardedspice?

PostPosted: Tue Jan 03, 2017 8:38 pm
by IAmMoen
So there is a github repo that is meant to be used with a bunch of different music providers and allows you to use the media keys on a mac to control a webpage. It used to work with Subsonic 5 but with the latest it looks like there has been some breaking changes with respect to the javascript. I am thinking it would be fairly trivial for a person in the know to make an update to the subsonic implementation for beardedspice. I am going to keep looking for a way to do it myself but in case someone sees this and thinks it easy or can point me to a place where I can see documentation on the frontend page for subsonic, that would be great.

Github project:

The particular "Media Strategy" in question: ... ubsonic.js

I will update this with anything I find.

Re: Update for beardedspice?

PostPosted: Tue Jan 03, 2017 8:46 pm
by IAmMoen
Ok I think I found the one to toggle play pause.

Code: Select all

Re: Update for beardedspice?

PostPosted: Tue Jan 03, 2017 9:53 pm
by IAmMoen
Ok I think I got it all now. I should actually get back to work...

Code: Select all
//  Subsonic6.plist
//  BeardedSpice
//  Created by Michael Alden on 6/16/2015.
//  Modified by Chris Moen on 01/03/2017.
//  Copyright (c) 2014 Tyler Rhodes / Jose Falcon. All rights reserved.
BSStrategy = {
  accepts: {
    method: "predicateOnTab",
    format:"%K LIKE[c] '*Subsonic*'",
    args: ["URL"]
  isPlaying: function () { return window.frames.playQueue.localPlayer.paused === false },
  toggle:function () { window.frames.playQueue.keyboardShortcut("togglePlayPause") },
  next:function () {
    var index = parseInt(window.frames.playQueue.getCurrentSongIndex()) + 1;
    window.frames.playQueue.skip(index, 0, true);
  favorite: function () {
    var index = window.frames.playQueue.getCurrentSongIndex();
  previous:function () {
    if (window.frames.playQueue.localPlayer && window.frames.playQueue.localPlayer.currentTime > 4.0) {
      window.frames.playQueue.skip(parseInt(window.frames.playQueue.getCurrentSongIndex()), 0, true);
    } else {
      window.frames.playQueue.skip(Math.max(0, parseInt(window.frames.playQueue.getCurrentSongIndex()) - 1), 0, true);
  pause:function () { window.frames.playQueue.localPlayer.pause() },
  trackInfo: function () {
    var index = window.frames.playQueue.getCurrentSongIndex();
    var rec = window.frames.playQueue.songs[index];
    return {
        'title': rec.title,
        'album': rec.album,
        'artist': rec.artist,
        'favorited': rec.starred,
        'image': rec.coverArtUrl.concat('&size=128'),