Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
OK, so I have a project that has been running for about a year using tiiny host (go.wisc.edu/nmfe).  I designed with the desktop first (since that was our demographics choice), but the plan always included a mobile-friendly version. The layout actually looks OK on a iPad and iPhone (I don't have a android to test on).  The problem is that it crashes on the iPhone.  I thought this was due to the layout.

So I made a vertical layout for the phone using an alternate layout.  When tested the vertical page looks great, but so does the horizontal (no crash). To troubleshoot this, I thought it might be a bad page in the 25 page file so I ran progressive exports adding a page at a time. When it crashed on page 13 (symbolic?) I thought I had it solved.  But then I kept going, starting with page 13 by itself and it worked fine.  Then I added pages one by one and it was fine until I hit page 25 (13 pages in).

So it seems like it's the number of pages doing it.  I am trying to figure out what to do but thought I would inquire to see if there is something that maybe you know about that I don't page count or file size.  My concern is that well, it would be nice to just be able to use it on an iPhone as it is now but also if I do a responsive, that basically doubles the page count and I don't want the existing site to suffer any negative consequences!  Thanks for any insight into this.  Mimi
in bugs by (370 points)
  
I should have mentioned that the alternate layout was only a single page of the project...

1 Answer

0 votes

We have seen reports from customers who get the following error message on iPhones using Safari:

“A problem repeatedly occurred on [URL]"

The problem is due to performance-heavy content that results in a memory crash on iOS. 

If you have lots of embedded content on your site, you can optimize it by reloading only the iframe that is actually playing. You can manually add the following code to in5.config.js to reload the iframe when it changes visibility from visible to hidden:

$(window).on('load', function(){
    function respondToVisibility(element, callback) {
        var observer = new IntersectionObserver((entries, observer) => {
            entries.forEach(entry => {
                callback(entry.intersectionRatio > 0);
            });
        });
        observer.observe(element);
    }
    $('iframe').each(function(_,el){
        respondToVisibility(el, visible => {
            var j = $(el);
            if (visible) {
                j.addClass('iframe-visible');
            } else if (j.hasClass('iframe-visible')) {
                j.removeClass('iframe-visible');
                if (stopIFrameOnNewPage || j.parents('.mso')) {
                    var src = j.attr('src');
                    j.attr('src', '');
                    if(j.attr('data-src')) j.siblings('.cover').show();
                    else j.attr('src', src);
                }
            }
        })
    })
});

You'll also need to manually remove the following function from in5.config.js:

function stopIframe(targ){
    $(targ).find('iframe').each(function(index,elem){
        var j = $(elem), src = j.attr('src');
        j.attr('src', '');
        if(j.attr('data-src')) j.siblings('.cover').show();
        else j.attr('src', src);
    });
}

and its usages:

if(stopIFrameOnNewPage) { stopIframe($prevActive); };

and reformulate the following condition

from:

if(targState.parents('.activePage').length || targState.parents('.fixed-item-wrap').length) { stopIframe($otherStates); }
    else{ var hideMSO=targState.parents('.mso[data-hidestart="1"]'); hideMSO.length&&hideMSO.addClass('hidden'); }

to:

if(!targState.parents('.activePage').length && !targState.parents('.fixed-item-wrap').length) { var hideMSO=targState.parents('.mso[data-hidestart="1"]'); hideMSO.length&&hideMSO.addClass('hidden'); }

To manually modify the code yourself, you can do the following:

  1. Open the in5.config.js file in a text editor such as TextEdit (macOS) or Notepad (Windows) or in an IDE such as Dreamweaver which is available if you have the full Adobe Creative Cloud subscription.
  2. Make the changes mentioned above.
  3. Save the changes.

If you're still having trouble, please send us both of the following to troubleshoot:

  • Your InDesign file or a sample file that recreates the issue
  • Your html5_output folder
You can send them here:
by (26.6k points)
Thanks.  Three questions:

Where do I put that first section of code?

Is Dreamweaver better to use than Notepad, can you tell I don't code :) ?

Do I have to do this each time?  I can just replace that file each time?

Also, I tried this in Google Chrome with the same result.  It works for a little while in Incognito mode but eventually crashes.