Announcement

Collapse
No announcement yet.

Announce: Material Skin

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Somehow I deleted my original post. Here it goes again...

    I just noticed the "Keyboard shortcuts" setting is not available in lms-material-app. Is this a limitation of the android app or is it something that can be activated somehow? My use case is lms-material-app on an AndroidTV (NVidia Shield) to view the now playing screen on the tv. If keyboards shortcuts were available I could play/pause or skip to next song with a remote programmed to send the keyboard shortcuts.

    Comment


    • ...and I could send "Play View' :-)


      Originally posted by shinedou
      Somehow I deleted my original post. Here it goes again...

      I just noticed the "Keyboard shortcuts" setting is not available in lms-material-app. Is this a limitation of the android app or is it something that can be activated somehow? My use case is lms-material-app on an AndroidTV (NVidia Shield) to view the now playing screen on the tv. If keyboards shortcuts were available I could play/pause or skip to next song with a remote programmed to send the keyboard shortcuts.

      Comment


      • Originally posted by shinedou
        Somehow I deleted my original post. Here it goes again...

        I just noticed the "Keyboard shortcuts" setting is not available in lms-material-app. Is this a limitation of the android app or is it something that can be activated somehow? My use case is lms-material-app on an AndroidTV (NVidia Shield) to view the now playing screen on the tv. If keyboards shortcuts were available I could play/pause or skip to next song with a remote programmed to send the keyboard shortcuts.
        Yeah, shortcuts are desktop only - as most touch/mobile devices do not have a real keyboard.
        Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

        Comment


        • Originally posted by cpd73
          Yeah, shortcuts are desktop only - as most touch/mobile devices do not have a real keyboard.
          Bummer, there are lots of Android boxes that support keyboards. If you ever run across a way to implement it please consider it. Thanks for your hard work.

          Comment


          • Originally posted by shinedou
            Bummer, there are lots of Android boxes that support keyboards. If you ever run across a way to implement it please consider it. Thanks for your hard work.
            If you use chrome, and not the material app, then material has an option to enable 'Lock screen and notifications' This uses a javascript 'mediasession' (the app uses WebView and this does not support mediasession). On a desktop browser this adds support for media-keys (i.e. play/pause). Its possible these keys also work with mobile browsers.
            Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

            Comment


            • Originally posted by shinedou
              I just noticed the "Keyboard shortcuts" setting is not available in lms-material-app. Is this a limitation of the android app or is it something that can be activated somehow? My use case is lms-material-app on an AndroidTV (NVidia Shield) to view the now playing screen on the tv. If keyboards shortcuts were available I could play/pause or skip to next song with a remote programmed to send the keyboard shortcuts.
              I might enable the playback shortcuts for mobile and desktop, but for now if you create a file named "custom.js" within a "material-skin" sub-folder of your LMS's "prefs" folder with the following contents, then it should work:

              Code:
              if (IS_MOBILE) { // desktop already catches  these shortcuts, so dont want them handled twice!
                  var playerIsPlaying = false;
                  Mousetrap.addKeycodes({ // Codes from https://github.com/wesbos/keycodes/blob/gh-pages/scripts.js
                      174: 'decvol',
                      175: 'incvol',
                      182: 'decvolfirefox',
                      183: 'incvolfirefox'
                  })
                  // 'bind' keys that we are interested in
                  bindKey('up', 'alt', true);
                  bindKey('down', 'alt', true);
                  bindKey('space');
                  bindKey('decvol', undefined, true);
                  bindKey('incvol', undefined, true);
                  bindKey('decvolfirefox', undefined, true);
                  bindKey('incvolfirefox', undefined, true);
                  bindKey('left', 'alt', true);
                  bindKey('right', 'alt', true);
              
                  // Act on keys being pressed
                  bus.$on('keyboard', function(key, modifier) {
                      // Ignore shortcurt if there is no player or we have a menu/dialog open
                      if (!store.state.player || store.state.visibleMenus.size>0 || (store.state.openDialogs.length>0 && store.state.openDialogs[0]!='info-dialog'))  {
                          return;
                      }
                      var command = undefined;
                      if (undefined==modifier) {
                          if (key=='space') {
                              command=[playerIsPlaying ? 'pause' : 'play'];
                          } else if (key=='incvol' || key=='incvolfirefox') {
                              bus.$emit('adjustVolume', true);
                          } else if (key=='decvol' || key=='decvolfirefox') {
                              bus.$emit('adjustVolume', false);
                          }
                      } else if ('alt'==modifier) {
                          if (key=='up') {
                              bus.$emit('adjustVolume', true);
                          } else if (key=='down') {
                              bus.$emit('adjustVolume', false);
                          } else if (key=='left') {
                              command=['button', 'jump_rew'];
                          } else if (key=='right') {
                              command=['playlist', 'index', '+1'];
                          }
                      }
              
                      if (command) {
                          lmsCommand(store.state.player.id, command).then(({data}) => {
                              bus.$emit('updatePlayer', store.state.player.id);
                          });
                      }
                  });
              
                  // Need to keep trak of whether current player is playing or not, so know when to play and when to pause
                  bus.$on('playerStatus', function(playerStatus) {
                      playerIsPlaying = playerStatus.isplaying;
                  });
              }
              Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

              Comment


              • Originally posted by cpd73
                I might enable the playback shortcuts for mobile and desktop, but for now if you create a file named "custom.js" within a "material-skin" sub-folder of your LMS's "prefs" folder with the following contents, then it should work:

                Code:
                if (IS_MOBILE) { // desktop already catches  these shortcuts, so dont want them handled twice!
                    var playerIsPlaying = false;
                    Mousetrap.addKeycodes({ // Codes from https://github.com/wesbos/keycodes/blob/gh-pages/scripts.js
                        174: 'decvol',
                        175: 'incvol',
                        182: 'decvolfirefox',
                        183: 'incvolfirefox'
                    })
                    // 'bind' keys that we are interested in
                    bindKey('up', 'alt', true);
                    bindKey('down', 'alt', true);
                    bindKey('space');
                    bindKey('decvol', undefined, true);
                    bindKey('incvol', undefined, true);
                    bindKey('decvolfirefox', undefined, true);
                    bindKey('incvolfirefox', undefined, true);
                    bindKey('left', 'alt', true);
                    bindKey('right', 'alt', true);
                
                    // Act on keys being pressed
                    bus.$on('keyboard', function(key, modifier) {
                        // Ignore shortcurt if there is no player or we have a menu/dialog open
                        if (!store.state.player || store.state.visibleMenus.size>0 || (store.state.openDialogs.length>0 && store.state.openDialogs[0]!='info-dialog'))  {
                            return;
                        }
                        var command = undefined;
                        if (undefined==modifier) {
                            if (key=='space') {
                                command=[playerIsPlaying ? 'pause' : 'play'];
                            } else if (key=='incvol' || key=='incvolfirefox') {
                                bus.$emit('adjustVolume', true);
                            } else if (key=='decvol' || key=='decvolfirefox') {
                                bus.$emit('adjustVolume', false);
                            }
                        } else if ('alt'==modifier) {
                            if (key=='up') {
                                bus.$emit('adjustVolume', true);
                            } else if (key=='down') {
                                bus.$emit('adjustVolume', false);
                            } else if (key=='left') {
                                command=['button', 'jump_rew'];
                            } else if (key=='right') {
                                command=['playlist', 'index', '+1'];
                            }
                        }
                
                        if (command) {
                            lmsCommand(store.state.player.id, command).then(({data}) => {
                                bus.$emit('updatePlayer', store.state.player.id);
                            });
                        }
                    });
                
                    // Need to keep trak of whether current player is playing or not, so know when to play and when to pause
                    bus.$on('playerStatus', function(playerStatus) {
                        playerIsPlaying = playerStatus.isplaying;
                    });
                }
                This works perfectly. Thank you! Everything is inching closer to being perfect.

                I only use this setup if I want to have the now playing up on the big screen which is not always. Now with this I can use my remote to pause/play and skip forward or backward. I do not use this setup to manage the queue anyway. I still would do that via my phone or PC.
                Last edited by shinedou; 2021-10-28, 19:34. Reason: added more info

                Comment


                • Maybe it's a silly suggestion, but what about making the green "Updates available" arrow background blue if the available update is for LMS (or the other way round) and maybe blue/green if there are updates for LMS and plugins available? That way it would be possible to see at a glance which kind of updates are available. Something like this:

                  Click image for larger version

Name:	lms_mat_updates.png
Views:	1
Size:	3.5 KB
ID:	1573533
                  QLMS [email protected] x64 (digimaster) / QNAP 469L (QTS 4.3.4)
                  LMS 8.4 x64 / Intel NUC8 i3 (Ubuntu 22.04.1 LTS)

                  Comment


                  • Originally posted by dolodobendan
                    Maybe it's a silly suggestion, but what about making the green "Updates available" arrow background blue if the available update is for LMS (or the other way round) and maybe blue/green if there are updates for LMS and plugins available?
                    No, too confusing. I fail to see why the type should be differentiated here.
                    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                    Comment


                    • Originally posted by cpd73
                      No, too confusing. I fail to see why the type should be differentiated here.
                      One type can be updated within Material (plugins), the other type cannot (LMS). To update LMS, I have to go to the nightly page, copy the link for my distribution, open a terminal, wget that link, and then install that file. To update a plugin, I click on download and then restart. That I could do easily from my phone.

                      Right now, I only see "Updates available", but I don't know if it's the type I can easily install from my phone. So I have to click and check by myself what kind of update it is. And I have to do that until I update LMS, otherwise, I never know if plugin updates are available, because it's the same icon. And then again, if a new nightly is available.

                      If I'd enable "Update plugins automatically" within LMS, I wouldn't get two types of notifications that look the same, but also I wouldn't be notified of any updated plugins that need a restart. That's why I thought that two icons for two different updates might be helpful.
                      QLMS [email protected] x64 (digimaster) / QNAP 469L (QTS 4.3.4)
                      LMS 8.4 x64 / Intel NUC8 i3 (Ubuntu 22.04.1 LTS)

                      Comment


                      • Originally posted by dolodobendan
                        One type can be updated within Material (plugins), the other type cannot (LMS). To update LMS, I have to go to the nightly page, copy the link for my distribution, open a terminal, wget that link, and then install that file. To update a plugin, I click on download and then restart. That I could do easily from my phone.

                        Right now, I only see "Updates available", but I don't know if it's the type I can easily install from my phone. So I have to click and check by myself what kind of update it is. And I have to do that until I update LMS, otherwise, I never know if plugin updates are available, because it's the same icon. And then again, if a new nightly is available.

                        If I'd enable "Update plugins automatically" within LMS, I wouldn't get two types of notifications that look the same, but also I wouldn't be notified of any updated plugins that need a restart. That's why I thought that two icons for two different updates might be helpful.
                        The type of updates available are shown in Material's information dialog. The 'Information' entry in the main menu is changed to have the update icon to indicate this.
                        Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                        Comment


                        • Hello, I do not think this has been asked before, if so, kindly point me to the post (did do a search and scroll for the best):

                          I have different versions of albums in my library (format, deluxe versions, bitrate, etc) that can be recognized by their folder/pathname. I would like to see that path in the left overview after a search or browse to result (underneath the actual album name).
                          Is it possible to configure this in settings or maybe adjust an xml entry to allow/enable this?

                          Thanks for any ideas,
                          Regards

                          Comment


                          • Originally posted by Huey11
                            I have different versions of albums in my library (format, deluxe versions, bitrate, etc) that can be recognized by their folder/pathname. I would like to see that path in the left overview after a search or browse to result (underneath the actual album name).
                            Is it possible to configure this in settings or maybe adjust an xml entry to allow/enable this?
                            No, sorry not supported.
                            Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                            Comment


                            • Originally posted by cpd73
                              The type of updates available are shown in Material's information dialog. The 'Information' entry in the main menu is changed to have the update icon to indicate this.
                              That's what I meant with

                              Originally posted by dolodobendan
                              So I have to click and check by myself what kind of update it is.
                              Is there an easy way to disable LMS update notifications?

                              Never mind:

                              Settings / Advanced / Software Updates / Software Updates: Don't check for software updates
                              Last edited by dolodobendan; 2021-10-31, 18:33.
                              QLMS [email protected] x64 (digimaster) / QNAP 469L (QTS 4.3.4)
                              LMS 8.4 x64 / Intel NUC8 i3 (Ubuntu 22.04.1 LTS)

                              Comment


                              • Originally posted by dolodobendan
                                Is there an easy way to disable LMS update notifications?
                                No.
                                Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                                Comment

                                Working...
                                X
                                😀
                                🥰
                                🤢
                                😎
                                😡
                                👍
                                👎