farpenoodle / StreamControl

StreamControl
http://www.farpnut.net/streamcontrol
Other
75 stars 32 forks source link

Issue with .html pages not updating from streamcontrol.xml file #20

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello,

I have been really liking the Streamcontrol tool but have been running into the issue of my .html files having a delay update from the streamcontrol.xml. The scoreboard-jstween.html file will keep changes from the streamcontrol.xml file and update quickly when using the streamcontrol.exe. However LowerThird_2lines.html will read from the streamcontrol.xml but after 5 - 10 minutes the text will appear.

I'm doing this on a local IIS windows server as that was the only way I could get Google Chrome to read the .xml files as they had to be served by http which was a trick to get working.

I have put he files up on my public domain and wanted to know if you could take a look?

From the html/css and little js coding I know, it seems the issue is within this function that is causing the delay of information to load from streamcontrol.xml

`function loadData() { xhr.open('GET', 'streamcontrol.xml?t='+Date.now()); xhr.send(); xhr.onreadystatechange = function(){ xmlDoc = xhr.responseXML;

mText1 = getValueFromTag(xmlDoc,'mText1'); mText2 = getValueFromTag(xmlDoc,'mText2');
timestampOld = timestamp; timestamp = getValueFromTag(xmlDoc,'timestamp');
} }`

I look forward to your response!

farpenoodle commented 8 years ago
var timeout = this.window.setInterval(function() {
                    pollHandler();
                }, 10);

My guess is that the polling rate for the lower third is way too fast. It's currently set at 10ms. Which is pretty overkill.

Try change it to 250ms like the other file.

ghost commented 8 years ago

Opps, I meant to put

http://hadokenxgaming.com/score-board/hxg-pages/LowerThird_2lines.html

Back to 250. I have done so and was testing that on localhost IIS server but same results. Just a big delay in reading the streamcontrol.xml file. Not sure what the cause is?

The data is there but can't seem to figure out why this issue is going on for lowerthird.html but not the jstween.html.

http://hadokenxgaming.com/score-board/hxg-pages/streamcontrol.xml

Thanks for your help.

farpenoodle commented 8 years ago

I think I see the problem. Try changing the start and stop times for the animation. For example in this block:

                if ($('#mText1').html() != mText1) {
                    animating = true;
                    $('#mText1').tween({
                        opacity: {
                          start: 100,
                          stop: 200,
                          time: 50,
                          duration: 0.5,
                          effect: 'easeIn'
                        },
                        onStop: function(){
                            $('#mText1').html(mText1);
                        }
                    });

                    $('#mText1').tween({
                        opacity: {
                          start: 100,
                          stop: 200,
                          time: 50,
                          duration: 0.5,
                          effect: 'easeOut'
                        },
                        onStop: function(){
                            animating = false;
                        }
                    });
                }

In the outro animation change start and stop to:

start: 200,
stop: 300,

Basically you're currently overwriting the animation all the time.

ghost commented 8 years ago

So I played around with some of the start, stop and time and found that "time" was what was causing the issue. With having a time of 50 set by default, this is making 50 seconds pass before the text will display. I lowered it to 0 sec and it works great!

$('#mText1').tween({ opacity: { start: 200, stop: 300, time: 0, duration: 0.5, effect: 'easeOut' }, onStop: function(){ animating = false; } }); }

Take a look!

http://hadokenxgaming.com/score-board/hxg-pages/LowerThird_2lines.html

farpenoodle commented 8 years ago

Cool. Good to hear!

ghost commented 8 years ago

Yes, thank you for helping me look into this. Has been driving me nuts for days! Glad I got it solved so I can pump out a handful of these scoreboards :-D