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.

    iFrame vs GIF

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    4 Posts 2 Posters 1.4k Views 3 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.
    • zdenekZ Offline
      zdenek
      last edited by

      I’m lost, please help…I’ve tried iFrame, iFrame-reload, iFrame-reload-ping, but nothing works. I would like to have on my mirror actual version of image located here - it’s animated GIF with radar measurement of clouds/rain in my country. The image is refreshed on the web every 10 mins I guess. and now the problem:
      iFrame - show the image, but there is no way for me to refresh (except restart MM)
      iFrameReload, iFrameReload-ping - doesn’t load image at all

      any idea?
      Thanks, Zdeněk

      ? 2 Replies Last reply Reply Quote 0
      • ? Offline
        A Former User @zdenek
        last edited by

        @zdenek
        I think that problem is caused by image cache.
        For performance, usual browser(and server) uses cache-control, so, your gif image would be cached.
        The easy solution will be change your URL slightly, like this;

        http://portal.chmi.cz/files/portal/docs/meteo/rad/mobile/ra6_30min.gif?SOME_RANDOM_SEED_VALUES
        

        But all of iFrame modules are not supported this feature.

        1 Reply Last reply Reply Quote 0
        • ? Offline
          A Former User @zdenek
          last edited by A Former User

          @zdenek
          I think MMM-Widget could solve this problem.
          Install that module and adjust config like this;

          {
                    //disabled:true,
                    module: "MMM-Widget",
                    config: {
                      widgets: [
                        {
                          position:"top_left",
                          html:`
                          < img src="" id="IMG" >
                          < script >
                          var draw = function(img) {
                            img.src = "http://portal.chmi.cz/files/portal/docs/meteo/rad/mobile/ra6_30min.gif?" + Date.now()
                          }
                          var img = document.getElementById("IMG")
                          draw(img)
                          setInterval(function() {
                            draw(img)
                          }, 1000 * 60 * 10) // will be refreshed every 60*10 secs.
                          < /script >
                          `,
                          width:"200px",
                          height:"200px"
                        }
                      ]
                    }
                  },
          

          (Remove space around side of < and >)

          zdenekZ 1 Reply Last reply Reply Quote 0
          • zdenekZ Offline
            zdenek @Guest
            last edited by

            @sean wow, thanks. That’s perfect. Just one point - I’ve it in top_center segment and the image is alligned to the left of that column. how to align it to center?

            I had no idea, how it works, but I guess via this modul is possible to get every data from every site, right? So, If I’ll need to get from here the last table on the bottom, is there way, how to do it?

            thanks, Zdeněk

            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