MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Help with Pages...

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    7 Posts 2 Posters 1.7k Views 2 Watching
    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.
    • justjim1220J Offline
      justjim1220 Module Developer
      last edited by

      anyone have an idea of how to disable, or stop, or pause, etc a module when the page changes away from the page the module is on?

      IE: I have 3 pages, on one of the pages, I have a module that plays music either by audio or video, currently, that module will continue playing no matter what page I go to. if the video player module is on page 3, then it should not be heard if on pages 1 & 2.
      Or if I have the Spotify module on page 1, then it shouldn’t be heard on pages 2 & 3.
      etc

      Any Ideas from anyone?
      I have tried a few searches without success

      Thanks in advance!

      "Life's Too Short To Dance With Ugly People"
      Jim Hallock - 1995

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @justjim1220
        last edited by sdetweil

        @justjim1220 I think u will need to add code to handle the hide/show.

        I think if I remember correctly, there is a player setting for allowing background play(or not)

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        justjim1220J 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil
          last edited by

          I think the Spotify module just shows what is playing elsewhere, not on the mirror itself

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • justjim1220J Offline
            justjim1220 Module Developer @sdetweil
            last edited by

            @sdetweil that’s what I am having the problem with. I use MMM-pages, it doesn’t really use a css file except to give the module position. so I have no idea how to set it up this way.

            Here’s another example:
            On page 1 I have MMM-Spotify
            Page 2 I have MMM-SoundMachine
            And page 3 I have MMM-MyVideoPlayer

            I would have the page swap set to say 3 hours, meaning it will change to the next page after 3 hours, So, if on page 1, MMM-Spotify is active and playing, then the modules on pages 2 & 3 are inactive (not playing). And, when the 3 hours is up and the page changes to page 2, then Spotify would become inactive, SoundMachine would become active, and the video player would remain inactive until the page changes to page 3.

            I hope this makes sense, I am not sure where in the configurations of the modules or in custom css or what to place code to make this happen, NOR, do I have any idea how to write the code for something like this.

            "Life's Too Short To Dance With Ugly People"
            Jim Hallock - 1995

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @justjim1220
              last edited by

              @justjim1220 each module would have to handle the hide(suspend)/show(resume) effect on themselves. Pages uses hide/show which turns into the suspend/resume calls

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              justjim1220J 1 Reply Last reply Reply Quote 0
              • justjim1220J Offline
                justjim1220 Module Developer @sdetweil
                last edited by

                @sdetweil

                looking through dev tools on this, I see when a page turns, whether by click or by timer, it will list all the modules from the current page and suspend them, then it lists all the modules for the second page and resumes them. And it looks as if it is done via notification.

                Is it possible to use the dev tools notification as a trigger to show/hide, suspend/resume, or disable/enable?

                @sdetweil said in Help with Pages...:

                @justjim1220 each module would have to handle the hide(suspend)/show(resume) effect on themselves. Pages uses hide/show which turns into the suspend/resume calls

                so, what I am getting from this statement, this can be done through the pages module???

                "Life's Too Short To Dance With Ugly People"
                Jim Hallock - 1995

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @justjim1220
                  last edited by

                  @justjim1220 no… each module has to add code to deal with it…

                  like your video player… add a suspend() routine to be called when hidden and a config option for backgroundPlay true/false

                  and if playing on suspend, and you’re supposed to stop, then stop playing…
                  and if resumed and were playing then resume playing, (if u can)…

                  but other modules will have to add code like that too… you cannot MAKE them behave

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy