Party Mode

Suggestions/requests/ideas for RuneAudio core features and functions

Party Mode

Postby gargamel » 11 Feb 2014, 23:18

i would like to see a sort of "Party Mode" where it locks out the ability to remove songs from a playlist.

also songs may only be added X amount of times within a certain time frame. this is would stop people from adding the one song over and over to the playlist.
*** --- __ Gargamel __ --- ***
gargamel
 
Posts: 1
Joined: 11 Feb 2014, 23:14

Re: Party Mode

Postby ACX » 11 Feb 2014, 23:46

Hi gargamel, this could be a low priority but still interesting feature to include in a future version.
In the meanwhile try to keep annoying people away from the RuneUI :D
Thanks for your suggestion!
User avatar
ACX
RuneAudio co-founder
 
Posts: 1687
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Party Mode

Postby millennia » 21 Sep 2016, 23:43

Hi eyeryone
and first of all: I am very sorry for grubbing out this oooooold thread. i came here years ago when i prepared the RuneUI for party. i just did a few manipulations on the css files, mostly
Code: Select all
display:none
and now i am about to prepare the UI once again. So i can make a few suggestions on this topic, but if i am right, we need a complete different build as my changes to the configurations are really not the majorities choice i guess.

Now I am working with a RaspPi3 - and because the device comes with WiFi onboard, i thought about using the RaspPi as an WiFi Access Point that provided all network services (DHCP and DNS) and that redirects every request to the http://runeaudio.
OK, lets get started with an update of the software lists, assuming you found out how to connect via SSH. (btw: if you dont know what i am writing about, you should not continue here.)
Connect the Pi via LAN to your network - we will work on the configuration of the wlan interface.
Install the Software
Code: Select all
pacman -Sy
pacman -S dnsmasq
pacman -S hostapd

configure hostapd
Code: Select all
nano /etc/hostapd/hostapd.conf

with the following lines
Code: Select all
ssid=Party
# wpa_passphrase=12345678
interface=wlan0
driver=nl80211
channel=7

Code: Select all
echo "DAEMON_CONF="/etc/hostapd/hostapd.conf" > /etc/default/hostapd
systemctl enable hostapd

configure dnsmasq
In the file
Code: Select all
nano /etc/dnsmasq.conf
you have to edit several lines:
Code: Select all
interface=wlan0
dhcp-range=10.1.0.50,10.1.0.200,12h
address=/#/10.1.0.1

(source, thx!)
activate the service with
Code: Select all
systemctl enable dnsmasq

now the DNS server returns the IP of the device only, but this wont have an effect on the URL. we need some redirects to be done by
ngix
Code: Select all
nano /etc/ngix/ngix.conf

Code: Select all
[…]
    # DISPLAY section [/]
    server {
        listen 80;
        server_name *.de *.com *.net *.org *.at *.uk ;
        return 301 http://runeaudio;
    }
#    server {
#        listen 80;
#        server_name *.*.*;
#        return 301 http://runeaudio;
#    }
    server {
        listen 80 default;
      add_header X-UA-Compatible "IE=Edge,chrome=1";
        server_name runeaudio;
        access_log  /var/log/runeaudio/runeui_access.log;
[…]

at last we have to set up an IP for wlan0 with
Code: Select all
ifconfig wlan0 10.1.0.1
. there must be a config file for this, but i am to lazy to look it up, so i set up an autostart script for the systemd:
Code: Select all
[root@runeaudio ~]# cat /etc/systemd/system/ifconfig.service
[Unit]
Description=Set IP of interface wlan0

[Service]
Type=oneshot
ExecStart=/root/autostart-ifconfig.sh

[Install]
WantedBy=multi-user.target

and the corresponding .sh
Code: Select all
#!/bin/sh
# just set an IP for interface wlan0
ifconfig wlan0 10.1.0.1

dont forget to
Code: Select all
chmod +x /root/autostart-ifconfig.sh
and to
Code: Select all
systemctl enable ifconfig.service

may be there are some better ideas how to get this work, feel free to share your thoughts!

OK, now we can use the WiFi AP and all requests will be redirected to runeaudio. now we have to "secure" our RuneUI:
CSS
I added a few lines to /srv/http/assets/css/runeui.css
Code: Select all
/* Party customization  */
li a[href="#poweroff-modal"] {
    display: none;
}
li a[href="/credits/"] {
    display: none;
}
li a[href="/debug/"] {
    display: none;
}
/* disable the menu */
#menu-settings {
    display: none;
}

/* disable all playback options on folders */
.db-folder > i {
    display: none !important;
}
a[data-cmd="lastfmaddreplaceplay"]{
    display: none;
}
a[data-cmd="addreplaceplay"]{
    display: none;
}
a[data-cmd="addplay"]{
    display: none;
}
#context-menu-file > ul:nth-child(1) > li:nth-child(2){
    display: none;
}
#context-menu-file > ul:nth-child(1) > li:nth-child(3){
    display: none;
}
#context-menu-file > ul:nth-child(1) > li:nth-child(4){
    display: none;
}

to disable some buttons and menus.
JS
I dont want the "add and play" feature on double clicks or double taps, so i changed it to simple "add":
Code: Select all
        // double click on Library list entry
        db.on('dblclick', 'li', function(e) {
            var el = $(this);
            if (!$(e.target).hasClass('db-action')) {
                $('li.active', '#database-entries').removeClass('active');
                el.addClass('active');
                var path = el.data('path');
                // console.log('doubleclicked path = ', path);
                if (el.hasClass('db-spotify')) {
                    path = el.attr('data-plid') + '-' + el.attr('data-path');
                    getDB({
                        cmd: 'spadd',
                        path: path,
                        querytype: 'spotify-track'
                    });
                } else {
                    path = (el.hasClass('db-dirble')) ? path.split(' | ')[1] : path;
                    getDB({
                        cmd: 'add',
                        path: path
                    });
                }
            }
        });


so far so good! these are my suggestions. within the css there are some more things we can do, e.g. removing the "remove from queue" button or the "delete queue" one. but all in all these steps make it a really cool jukebox device for your party!
but you should not forget that this is not a secure solution. via the URL /settings/ all your guests can change the options there and i always recommend to use passwd after the first login or - better - the usage of ssh keys.
I dont see any chance to include these settings into RuneOS. But we can write an installation script for all of this…

So - at the end of this posting i like to say:
Thanks to the Rune team - what you provide here is outstanding!
millennia
 
Posts: 3
Joined: 21 Sep 2016, 22:58
Location: Germany

Re: Party Mode

Postby hondagx35 » 22 Sep 2016, 08:33

Hi millennia,

welcome to Rune Audio and thank you for sharing this.

may be there are some better ideas how to get this work, feel free to share your thoughts!

Please see here.

Frank
User avatar
hondagx35
 
Posts: 3041
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Party Mode

Postby millennia » 22 Sep 2016, 14:09

Ahhhh, OK. so nothing new according to the Access Point Feature.
So forget everything besides the CSS/JS thing :D
millennia
 
Posts: 3
Joined: 21 Sep 2016, 22:58
Location: Germany

Re: Party Mode

Postby hondagx35 » 22 Sep 2016, 17:31

Hi millennia,

So forget everything besides the CSS/JS thing :D

Absolutely no. I'm happy to see, that you did it nearly the same way as i did.
The only difference is that i did it with full Rune Audio integration.
With my solution you get an automatic AP, if no IP is assigned to wlan0 the AP gets started.
A settings page for the AP and IP settings will follow soon.

Frank
User avatar
hondagx35
 
Posts: 3041
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Party Mode

Postby millennia » 23 Sep 2016, 19:35

A very good idea to use the wlan interface in this case.
I further thought about the party mode feature. I think with your "Auto-Wifi-AP" configuration, we can use the dnsmasq to set a static IP for admin clients and deliver the standard runeui.css file to these admin clients. all other will receive the "partymode.css" additions with disabled features. with a little JS we can setup the limitation for queue additions as well.
with a little help i can code these options and provide a pull request to the corresponding git repositories, but i will not start coding this stuff without a chance of implementation. i have to figure out correct ngix config - and i am more on the apache-httpd side of life...
the dark side of my recommendation is that it will be not that secure. we can exclude links like "/settings/" for user clients and also blacklist MPD commands in ngix config, but i can not guaranty for the security at all.
millennia
 
Posts: 3
Joined: 21 Sep 2016, 22:58
Location: Germany

support RuneAudio Donate with PayPal


Return to Feature request

Who is online

Users browsing this forum: No registered users and 1 guest