MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    MMM-NewsFeedTicker not displaying full article, etc.

    Troubleshooting
    2
    3
    270
    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.
    • W
      whoremoan last edited by

      I’ve seen a couple of things regarding the issue of the news ticker not displaying the full article from the RSS feed and also displaying the same story twice in a row, but I can’t seem to find any solution to it.

      So what happens is, the headline starts to scroll across the screen and will end before the full headline has been displayed.
      The news ticker will then display exactly the same headline again before moving on to the next one, but then the same thing happens.
      From other posts I’ve seen, there seems to be an opinion that the current headline will be displayed for a number of seconds before moving to the next headline.
      I’ve found that regardless of whether I have the ticker running at a fast speed or an incredibly slow speed, the headline will cut off at pretty much exactly the same place.
      So I’m guessing that if it is timed, increasing and decreasing the animation speed, also speeds up and slows down the clock that is timing the change in headline?

      I’m using a raspberry pi with a 3.5" LCD screen, so this news ticker is ideal for displaying a lot of information with only a small amount of space to play with.
      I did also install it on a PC running Ubuntu using all the default config files and it does exactly the same thing on that.

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

        @whoremoan the code does

        initial calc

         tickerBody.style.animationDuration = Math.round(this.config.updateInterval / 1000) + "s";
        

        this one u can change in config

        then using the actuals it does

                        function calcSpeed(speed) {
                            // Time = Distance/Speed
                            var spanSelector = document.querySelectorAll("headline"),
                                i;
                            for (i = 0; i < spanSelector.length; i++) {
                                var spanLength = spanSelector[i].offsetWidth,
                                    timeTaken = spanLength / speed;
                                spanSelector[i].style.animationDuration = timeTaken + "s";
                            }
                        }
                        calcSpeed(100);
        

        so, it calculates seconds in characters divided by 100/second,

        this second one for me is suspect, as until getDom() returns the 1st time, there are NO spans with headline class IN the dom.
        then on each other pass, there is the old one being replaced

        so THIS new (about to be shown headline is a fixed rate. regardless of content size

        probably the bigger problem is that the end of animation calls

          scheduleUpdateInterval: function() {
                var self = this;
        
                self.updateDom(self.config.animationSpeed);
        
                timer = setInterval(function() {
                    self.activeItem++;
                    self.updateDom(self.config.animationSpeed);
                }, this.config.updateInterval);
            },
        

        which refreshes the content AND starts a repeating time that does that too… on a fixed schedule.
        but it keeps starting new timers, on top of prior timers…

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 1
        • W
          whoremoan last edited by

          I passed this over to my brother, who is good with things like Java and CSS and got him to take a look and he has managed to fix the issue.
          It was the NewsFeedTicker’s CSS file that was causing all of the issues.
          To get round the main issue of the full article not being displayed involved placing the marquee inside an absolute position container. He then did a couple of other tweaks to get it working fully.
          So now when it runs it calculates the length of text to be displayed and then calculates the speed in which it needs to run to display the text over a 60 second period (as 60 seconds is what I have set as my update interval in the config file).
          As soon as the 60 seconds is up, the text has finished displaying and it moves on to the next article, So no more displaying the same item multiple times in a row.
          The only down side to this is if you use an RSS feed that displays a lot of text, it’s going to fly across the screen really fast, in order to make sure everything is displayed within 60 seconds.
          I’ve found most news RSS feeds have a fairly short headline and description and the speed is perfect.

          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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy