10 Replies Latest reply on Jan 8, 2014 2:11 AM by robboerman

    Videos not loading correctly on first online call... desperate

    mbranco_001

      Weird problem here, folks.  I have a web page created in Edge Animate that plays (4) videos simultaneously and that works fine using "Preview in Browser."  It will NOT load correctly the _first_ time it's called from the website.  It only partially loads – everything but the videos – the first time an uncached browser (Firefox, Opera, Chrome, Safari) tries to load the page.  However, after trying to load the page that first time, if you immediately go to any other website, and then return to my site to load the page, the page will load correctly.  This is killing me.  I'm guessing this behavior will immediately be recognized by someone who can point me to a solution.

       

       

      To view this behavior:

       

       

      1)  Go to http://www.lightisrising.com

       

              A partial page (without animation in the upper left, lower left, middle right, and lower right cells) will load.

       

      2)  Go to a different website, such as Adobe.com

       

      3)  Return to www.lightisrising.com, and the page will load and play the videos correctly.

       

       

       

      Obviously, I need the page to load correctly the FIRST time someone visits it.

       

       

       

      Thanks in advance for any help. Much appreciated.

        • 1. Re: Videos not loading correctly on first online call... desperate
          resdesign Adobe Community Professional & MVP

          Sorry I did not see your post here.

          I noted this on the FF console - you might want to check it out.

          error 1

          01 The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it.

          error 2

          Use of getPreventDefault() is deprecated.  Use defaultPrevented instead

           

          Can you post your code?

          1 person found this helpful
          • 2. Re: Videos not loading correctly on first online call... desperate
            mbranco_001 Level 1

            Redesign, thank you for your quick reply. 

             

            1) Any ideas how I would go about correcting error 1?  Sorry to be obtuse... it's not an error I've encountered before.

             

            2) The only place I can find getPreventDefault() is in the jquery-1.7.1.min.js file. Is that correct?  With that in mind, should I be using a more recent jquery-min version? I believe jquery-1.10.1-min.js is relatively stable, though I don’t know whether getPreventDefault() has been replaced with defaultPrevented.

             

            3) I can post code… what in particular would be most helpful?

             

            Thanks again for your suggestions.

            • 3. Re: Videos not loading correctly on first online call... desperate
              elainecc Adobe Employee

              Hi, mbranco-

               

              I responded to your other post instead of this one.  Marie, can you ping Rob to see if there might be a race condition happening?

               

              -Elaine

              1 person found this helpful
              • 5. Re: Videos not loading correctly on first online call... desperate
                mbranco_001 Level 1

                Elaine, thanks to you and Marie for investigating this issue.  Much appreciated.  I will hold tight for the moment in case you're able to provide additional info.  Again, thanks for your help.

                 

                Matt

                • 6. Re: Videos not loading correctly on first online call... desperate
                  robboerman Level 4

                  it seems to be a html5 video bug. with multiple autoplaying videos it goes to display:none; the first time it loads.

                  i'm still working on edgehero 0.3 and i fixed it already there, just by adding css display:block; to the video tag.

                   

                  I hope that helps you to fix it.

                   

                  - Rob

                  • 7. Re: Videos not loading correctly on first online call... desperate
                    mbranco_001 Level 1

                    Rob, it's great you were able to troubleshoot that issue.

                     

                    With that in mind, where should I place the CSS "display:block" code?  I'm not seeing a video tag anywhere obvious.  Would it go in the EdgeHero JS file, or in the edgeherostyle.css file, or in the of the HTML file... or somewhere else? If it goes anywhere but in the of the HTML file, what would the exact syntax be?

                     

                    The possibly relevant code in the edgehero-0.2-min.js file:

                     

                    $("[class^='videolink'],[class*=' videolink']").each(function(){var activeVi=$(this).attr("class");$(this).replaceWith('<video height="auto" id="'$(this).attr('id')'" class="'activeVi'" style="'$(this).attr('style')'">'$(this).html()'</video>')});

                     

                    $(".videolink_1").each(function(){$(".videolink_1").attr("src",videolink_1);});$(".videoli nk_1_mp4").each(function(){$(".videolink_1_mp4").append('<source src="'videolink_1_mp4'" type="video/mp4">');});$(".videolink_1_webm").each(function(){$(".videolink_1_webm").appe nd('<source src="'videolink_1_webm'" type="video/webm">');});$(".videolink_1_ogg").each(function(){$(".videolink_1_ogg").appen d('<source src="'videolink_1_ogg'" type="video/ogg">');});

                     

                    BTW, I extended the .js file to allow for (4) simultaneously playing videos, whereas the original allowed for (3) videos to play.

                     

                    Thanks much for your help.

                     

                    Matt

                    • 8. Re: Videos not loading correctly on first online call... desperate
                      robboerman Level 4

                      this should be the code for the top one then.

                       

                      $("[class^='videolink'],[class*=' videolink']").each(function() {

                      var activeVi = $(this).attr("class");


                      var b = $(this).attr('style')+'display:block;'

                              $(this).replaceWith('<video height="auto" id="'+ $(this).attr('id') +'" class="+ activeVi +" style="'+ b +'">' + $(this).html() + '</video>')

                          });

                       

                      it will add display:block; to the css style.instead of using display none. (invisible)

                       

                      everything in 0.3 will be unlimited btw.

                       

                      - Rob

                      • 9. Re: Videos not loading correctly on first online call... desperate
                        mbranco_001 Level 1

                        Rob, thank you for posting the revised JS code.  I got a syntax error after copying/pasting it into the JS file, but I tried it exactly as you sent it to me, as below:

                         

                        $("[class^='videolink'],[class*=' videolink']").each(function(){var activeVi=$(this).attr("class");var b = $(this).attr('style')'display:block;'$(this).replaceWith('<video height="auto" id="'$(this).attr('id')'" class="'activeVi'" style="'$(this).attr('style')'">'$(this).html()+'</video>')});

                         

                        Didn't work for me.

                         

                        I added a "" (plus-sign) after the 'display:block;'$(this), which eliminated the syntax error (and may have caused its own issues), but still didn't load the videos on first try.  In good conscience, I can't ask/expect anyone to spend any additional time on this, and I thank you again for the time you did spend on it.

                         

                        It's just so weird... it NEVER loads on first try, and it ALWAYS loads after immediately going to another site and then returning.  I can't fathom it.  Perhaps EdgeHero 0.3 will do the trick.

                         

                        Best regards,

                         

                        Matt Branco

                        • 10. Re: Videos not loading correctly on first online call... desperate
                          robboerman Level 4

                          i will email you a beta version of the next version over a few hours and an explanation about how to add videos there ( codes are alot more dynamic so even less code there.)