BGS
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login

    Suggestion: play sound when it's your turn when the tab is active too

    Scheduled Pinned Locked Moved Comments & Feedback
    feature request
    5 Posts 2 Posters 57 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      Ewan
      last edited by coyotte508

      I currently have the option Play a sound when it's your turn in one of your games enabled, but the sound only triggers when the tab is not active. As I'm using multiple browser windows, I always have to make sure to switch to another tab before switching to another window. Can you make it so that the sound also plays when the tab is active? I'm using firefox by the way, maybe it works differently on other browsers.

      1 Reply Last reply Reply Quote 0
      • E Offline
        Ewan
        last edited by

        Currently my settings are not saved, the sound notification box remains disabled after reloading the page.

        C 1 Reply Last reply Reply Quote 0
        • C Offline
          coyotte508 @Ewan
          last edited by

          @Ewan said in Suggestion: play sound when it's your turn when the tab is active too:

          Currently my settings are not saved, the sound notification box remains disabled after reloading the page.

          That particular issue was just fixed.

          Concerning the broader issue - we don't want to have too many settings and sub settings. Especially since sound notifications don't work well across all browsers, like chrome, which has protections against playing sounds unprompted.

          It will depend on how many other players have this issue.

          1 Reply Last reply Reply Quote 0
          • E Offline
            Ewan
            last edited by Ewan

            Concerning the broader issue - we don't want to have too many settings and sub settings.

            Fair enough. For those interested, I've written a small JavaScript snippet that plays the notification sound every time the counter increases. It can be loaded in e.g. Violentmonkey:

            // ==UserScript==
            // @name        Sound on your turn
            // @namespace   Violentmonkey Scripts
            // @match       https://www.boardgamers.space/*
            // @grant       none
            // @version     1.0
            // @author      -
            // @description Plays notification sound whenever the active games counter increases
            // ==/UserScript==
            
            function playSoundOnFirstActiveGame() {
              let gameCountNode = document.getElementById("active-game-count");
              window.currentActiveGames = parseInt(gameCountNode.innerHTML);
            
              let sound = document.getElementById("sound-notification")
            
              window.activeGamesObserver = new MutationObserver(() => {
                let newActiveGames = parseInt(gameCountNode.innerHTML);
                if(newActiveGames >= window.currentActiveGames) {sound.play();}
                window.currentActiveGames = newActiveGames;
              })
            
              activeGamesObserver.observe(gameCountNode, {childList: true, attributes: true})
            }
            
            setTimeout(playSoundOnFirstActiveGame, 3000);
            
            C 1 Reply Last reply Reply Quote 1
            • C Offline
              coyotte508 @Ewan
              last edited by

              @Ewan Very nice :)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post