Openframe-slideshow works but?

Hey Jim…so the openframe-slideshow actually works fine BUT and I see in the code it has a 1 minute default timer for display. So two questions…is it possible to install the extension with a different time something like openframe -i openframe-slideshow 2 for a 2 minute time (I tried that but nothing :wink: …it’s easy enough to change the code but I’m unclear how to get npm to see the new modified extension package…I’m an npm newbie…should I could clone the github change the code but I’m unclear as to next steps…anyway…thanks in advance for help!
Sandy

I mean Jonathan :wink:

(no problem :slight_smile:

Nice to know it still works! And actually you can change the duration without changing any code, it’s just a bit of a hidden feature :smiley: right now. You can see in the getDuration function within the extension that it’s looking for the duration in a couple places before falling back to the default. The Openframe API lets users manage various settings for their frame, and in addition extensions can specify setting properties that can be set on the Artwork or Frame level, scoped to the package name of the extension. In the case of this extension, it first checks to see if the current Artwork specifies a duration, if not it checks the frame, and then falls back to the default. In your case you probably want to set that property on the Frame itself.

The tricky part is that we haven’t yet built the UI for managing settings. Our idea was that an extension would specify the names and types of the settings it offered, and the Openframe web app would display them and let the user manipulate them. However at the moment you have to use the API directly. So here’s a step by step on how to do that:

  1. Go to the Openframe API explorer.
  2. Go to the user login endpoint, and in the ‘credentials’ box enter a json object containing your username and password, like: { “username”: “…”, “password”: “…”}, then click “Try it out!” This will give you a login token in the “response body” text area.
  3. Copy the id value from the login response (that’s the token) to the “access token” field at the top of the page and click “Set Access Token”. Now you’ll be able to hit other API endpoints in the explorer as your logged in user!
  4. Now we want to update the settings for your Frame. First, go to the user owned frames endpoint and type ‘current’ in the id field. You can use ‘current’ in place of the user id anywhere in the API and it will use the currently logged in user (you). Hit ‘try it out!’ to get a list of your frames.
  5. Find the frame object you want to update (you may well only have one frame). Copy the entire frame JSON object.
  6. Go to the update frame endpoint and paste the frame JSON object into the “data” field. Copy/paste the frame’s “id” property into the id field. Then in the frame JSON object, change the settings property so that it has the setting you want for the slideshow extension, e.g.: “settings”: { “openframe-slideshow”: { “duration”: 5}} (the duration value is in minutes)
  7. Click ‘Try it out!’. If all goes well, you should now see the updated settings in the response body.
    That should be it. Using that frame setting you should be able to set the duration of the slides for the slideshow extension. Sorry it’s not simpler. The API is quite flexible and fairly well thought out… we just need to get a UI in place for it so users don’t need to manually use the API like this!

Let me know if you hit any issues… good luck!

Jonathan

Oh is that all :wink:
Thanks for the very DETAILED description!

I got it partially working got through most of the API tool…(that’s some amusing web wizardy!) …I’ll get it to work fully eventually…just some syntax BS with json … and it want’s me to keep authenticating …but its very cool!

Speaking of user interface…this would be a change to the open-frame server right? Looking at the github there is a shitload of work you put into this! Very impressive…anyway thanks! Will keep ya posted if I do anything useful…Sandy

Got it to work!
Plugged through all the JSON stuff …it helps to actually read the documentation you send I hadn’t pasted in the id in that last step so kept getting authentication issues :wink: Anyway was able to modify the duration…most interesting methodology!

One minor bug in your documentation you don’t want to paste in the entire JSON of the Frame object because the “frame” object itself is not specified in the model so it freaks out…you just remove the name “frame” and a brace and bracket on bottom on top and it’s all good.

Will have to look into hacking the server to add some UI the section where you specify “frame setting” via the gear icon seems a convenient place to set a duration…hmmm … any thoughts about that?

Sandy

Great! Yeah, sorry, I should have been a bit more clear about what constituted a ‘frame object’. But glad you figured it out!

We definitely did put a ton of work into this thing, you’re right about that! It’s still a good foundation for future enhancement, just haven’t had the time to work on it again. Because we’re not selling an actual hardware ‘Frame’ (like Electric Objects, Framed, Meural, etc.) our potential audience is limited. But if/when we ever have some time I hope to pick up where we left off…

Regarding the UI, it would be part of the Openframe-WebApp component of the project. (Unfortunately this bit has the least documentation.) This is the code for the actual web app, written using React, that’s being served from openframe.io. Our idea was that we’d have some kind of specification for defining property types that extensions could implement, and then based on these property types we’d display the appropriate form fields in the ‘Frame’ and ‘Artwork’ edit screens in the web app so that users could update the setting properties for the extensions they’ve installed.

Something like this project from mozilla might be useful, at least as a reference if not for actual use within the web app: https://github.com/mozilla-services/react-jsonschema-form

Jonathan