FPP Display Voting Website & Yet another 'Christmas Light Finder'

jaredo

if (blink==true){ doFlash(); }
Joined
Feb 16, 2011
Messages
26
Location
Rockhampton
Hi All,

I've been working on a project on and off for the past year or so. It's primary focus is allowing/enabling voting on sequences in my display and secondary as a Christmas light finder for my local community.
I'm intending to let viewers use this functionality in 2017

The aim was to make the site very mobile friendly by making it a Single Page Application (SPA) web app, It's my first time approaching web applications in this manner and has been quite a fun challenge, back-end coding is my forte (very much coding random web stuff regularly), front end GUI not so much.

Website (still doing tweaks & bugfix)
https://christmaslightsnear.me (HTTPS is forced here, google maps requirement)

FPP Plugin
The FPP plugin has been written, seems to work well in my bench testing.
I've built it with every option I needed for my display this year,
https://github.com/jaredb7/FPP-VotingAPI-Integration
If you wish to play with it, you'll need to change the API Server under Advanced Settings to "Development"
Then use the Dev site below.

I just wanted to show everyone what I've been working on and get a feel of what others think?
Spoiler content hidden. Log in to see this content.
If you find any issues / bugs let me know.
Site may randomly break!!

Basic features:
Playlist voting (for displays that have this turned on)
'Now Playing' shown on website
Geolocation - Maps all use the users location, if they open the website outside your display, they will have your display show up in front of them.
Radius Search for displays around you (reliant on displays being added)
Address Search to find displays at a location
Favourites & "To Visit" list (very basic)
Google Maps Directions to a display or through list of displays (via to visit)
Adding / Editing displays
Creation of "devices" & API key (this gets placed into the plugin configuration)


Tech Features, which you may or may not care about:
Stateless authentication through the use of Tokens
Almost all requests checked for authentication where required.
API Rate limiting on voting API's (to prevent abuse)
Checks on Voting API so votes aren't accepted outside the Displays show times.
Device API creates in a basic way so it can be used for systems other the FPP.
Security checks for display/device modification (preventing abuse)
Client Side Image resizing (saves uploading 4-10MB images to the back-end for processing)

Stuff that doesn't work:
Favourites or "Displays to visit" aren't saved to the server, it's currently being stored in your browsers 'Local Storage' area which is similar to cookies. So favourites added through your PC, won't show when/if you the site on your phone
I didn't have time to develop this further. Works good enough for now

More Screenshots / https://imgur.com/a/rGik2

desktop_full.png desktop_full_display_view.png desktop_full_display_view_voting.png
View post on imgur.com
 
Last edited:

Boof63

Senior elf
Joined
Nov 7, 2011
Messages
585
Location
Kadina
Would like to say well done- looks like a lot of work.. would like to try it out just for voting on sequence, But i have a captive audience (no one else for 100km) so they have to enjoy my selections (insert evil laugh):), Regardless congrats, looks the goods to me.
Cheers Boof63
 

jaredo

if (blink==true){ doFlash(); }
Joined
Feb 16, 2011
Messages
26
Location
Rockhampton
The all precious dev environment is available, have a look around and let me know.
Spoiler content hidden. Log in to see this content.
If you find any issues / bugs let me know.
 
Last edited:

Ellis

Naughty Elf
Joined
Aug 21, 2017
Messages
207
Location
Gold Coast
The all precious dev environment is available, have a look around and let me know.
Spoiler content hidden. Log in to see this content.
If you find any issues / bugs let me know.

Bad link
 

jaredo

if (blink==true){ doFlash(); }
Joined
Feb 16, 2011
Messages
26
Location
Rockhampton
omg it's aliveeeeeeeeee.
4 hours of careful coding and chin scratching - polling & playing of the highest voted playlist item via the website is a thing now.
FPP doesn't support or can't (probably for obvious reason) go play a playlist when it's running a scheduled playlist. Seems to cause FPP to restart the currently playing sequence.
Forcing FPP to stop playing the current playlist is a bit of a risky move so a bit of time was trying to make sure if it did fail or jam up while stopping the currently playlist, the plugin would give FPPD a big kick (eqiv to hitting "Restart FPPD") as a last resort to get it running again (won't attempt to play whatever playlist it was trying to play).

A event at the start of the Playlist fires off a rather lengthy script that checks for the most voted item, creates/recreates a new playlist for that item.
Does a bucket load of checks, then tells FPP to stop/pause, then tells it to play that playlist in non-repeating mode.
By some feature, fluke or bug, if you're running under a schedule, after that playlist is done FPP reverts to the set schedule playlist to start the process again.
That's really quite handy, and the plugin leverage's that to get the job done.

plugin keeps track that it transitioned to another playlist, that way when FPP returns to your schedule playlist (thus running event again)it doesn't then go off in a infinite loop of playing the highest voted item.
The set schedule playlist will play in full & repeat, where it runs the event again and go we off play whatever.

I'd file this whole thing under "bleeding edge / experimental" most because of the whole "stopping running playlist" thing.
FPP 2.0 was meant to make that easier, hopefully we see that next year.

Bit of a demo, screen isn't exactly clear though
Goes from Schedule Playlist > Repeat then running event > plays skrillex as its the most voted item > it ends > back to schedule playlist > I vote Carol of the bells over and above the skrillex track > wait for schedule playlist to loop around & run event > plays carol of the bells
 

jaredo

if (blink==true){ doFlash(); }
Joined
Feb 16, 2011
Messages
26
Location
Rockhampton
Just a update on this whole crazy thing. Literally out of time for anything else, time to move to prop build.

But have managed to get things together, at the very least I wanted to give this a shakedown on my own display this year.

FPP Plugin
FPP plugin has been fully written, tested and seems to work fairly well.
Also sends now playing data to the website, this gets shown about the playlist, website polls for updates every 10 seconds.
Now playing is sent every time a new sequence starts. The website determines when this should stop showing based on time submitted and media length
https://github.com/jaredb7/FPP-VotingAPI-Integration

have included images so you can get an idea of what the settings page looks like + have a read of the option descriptions and see if they make sense.

Website:
https://christmaslightsnear.me
Website is public facing now, Have lost track of what I changed on the website, but put in a feature I wanted which was to be able get a URL/Link for your display so you could link people directly to the displays page. Few tiny bugs and usability issues but nothing major.

Links are a little like this
Spoiler content hidden. Log in to see this content.

Still very much "experimental" but comments on where this should go from here and questions welcome.

Keith is looking into putting this functionality into a tool for xLights too so those wanting to tinker there will able to.
 
Last edited:
Top