Update for beardedspice?

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Update for beardedspice?

Postby IAmMoen » Tue Jan 03, 2017 8:38 pm

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: https://github.com/beardedspice/beardedspice

The particular "Media Strategy" in question: https://github.com/beardedspice/bearded ... ubsonic.js

I will update this with anything I find.
IAmMoen
 
Posts: 3
Joined: Tue Jan 03, 2017 8:30 pm

Re: Update for beardedspice?

Postby IAmMoen » Tue Jan 03, 2017 8:46 pm

Ok I think I found the one to toggle play pause.

Code: Select all
parent.frames.playQueue.keyboardShortcut("togglePlayPause")
IAmMoen
 
Posts: 3
Joined: Tue Jan 03, 2017 8:30 pm

Re: Update for beardedspice?

Postby IAmMoen » Tue Jan 03, 2017 9:53 pm

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 = {
  version:1,
  displayName:"Subsonic6",
  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();
    window.frames.playQueue.onStar(index);
  },
  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'),
    };
  }
}
IAmMoen
 
Posts: 3
Joined: Tue Jan 03, 2017 8:30 pm


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 10 guests