• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.5k 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.
  • Z Offline
    zdenek
    last edited by Oct 12, 2018, 11:59 AM

    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 Oct 12, 2018, 2:59 PM Reply Quote 0
    • ? Offline
      A Former User @zdenek
      last edited by Oct 12, 2018, 2:59 PM

      @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 Oct 12, 2018, 3:22 PM Oct 12, 2018, 3:17 PM

        @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 >)

        Z 1 Reply Last reply Oct 14, 2018, 7:01 AM Reply Quote 0
        • Z Offline
          zdenek @Guest
          last edited by Oct 14, 2018, 7:01 AM

          @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
          1 / 1
          • First post
            1/4
            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