Topic: bizarre behavior on mobile with use of flashvars.firstImageIndex

I've been using flashvars.firstImageIndex to start a slideshow at an image specified by an index.  No problem at all on non-mobile platforms.  However, I've found a strange bug with using firstImageIndex on the iPhone/iPad mobile platforms.

The gallery.xml is configured by default to mobileShowNav=TRUE, mobileShowThumbs=TRUE, mobileShowCaption=TRUE

To explain the problem I'd first like to set the baseline behavior that uses only the standard index.html to enter the slideshow

a - a grid of 2x4 thumbnails is show (there is no option to set gridsize for mobile?)

b - I tap any photo in grid, let's say, index position 4

c - the slideshow begins FULL SCREEN image tapped in thumbnail grid
   - I can swipe left and right to move through photos
    - a thumbnail grid icon appears in top right of screen, tapping returns to thumbnails
   - pitch-zoom is not allowed

(2) USING flashvars.firstImageIndex

a - with flashvars.firstImageIndex = 4 using code below in an alternate index.html I start the slideshow at image index 4

b - The slideshow correctly starts at image index 4.

c - the image is show in an HTML page with location bar instead of full screen as in (1c)

Instead of showing the image full screen on the iPhone/iPad as in (1c), the image appears within an an html page. There i with the location bar at the top.  The page can be pitch-zoomed like any other html page.

TWO icons appear in the top right of page (above image) as opposed to a single thumbnail grid icon  in (1c)
  ; a thumbnail grid icon  and full screen icon

d- tapping the full screen icon enters mode of (1c) above -- full screen, swipe left and right to move through images

BUT again, both a thumbnail grid icon and a full screen icon appear.  The image is already shown full screen (the slideshow).  Tapping the superfluous full screen icon shows the image in a HTML page again (location bar / pitch zoom) with no icons at all.

You can get the player into all sorts of bizarre states by tapping the grid and full screen icons as they appear and disappear.  The player gets totally confused as to whether it's in full screen-non html mode, or showing images in an HTML page.

Starting a slideshow using  flashvars.firstImageIndex should do the same thing (not freak out) on the mobile player for iPhone/iPad as when using the standard index.html + thumbnail tap.


firstImageIndex code

<html>
<head>
</head>
<body>

    <!--START SIMPLEVIEWER EMBED -->
    <script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
    <script type="text/javascript">
   
    //JavaScript Embed
    var flashvars = {};
    //Set enableAPI to true to use JS API
    flashvars.enableAPI = "true";                     
    //Set 'firstImageIndex' based on the 'index' query string parameter
    flashvars.firstImageIndex = INDEX_NUMBER_HERE;

    simpleviewer.ready(function () {
        simpleviewer.load('sv-container', '100%', '100%', 'FFFFFF', true, flashvars);
    });
    </script>
    <div id="sv-container"></div>
    <!--END SIMPLEVIEWER EMBED -->

</body>
</html>

Re: bizarre behavior on mobile with use of flashvars.firstImageIndex

The 'Full Window' button in the Mobile Player should be displayed only if the dimensions of the gallery are not 100% x 100%.
Also, flashvars.enableAPI = "true"; is not required to use firstImageIndex.
Please post the URL to your gallery which is exhibiting this strange behavior so that we can take a look.

Steven Speirs
SimpleViewer Support Team.

Re: bizarre behavior on mobile with use of flashvars.firstImageIndex

Thanks for the reply.

You can see the behavior that relies on the use of firstImageIndex here.   

http://www.jasonwinshell.com/content/galleries/people/

This URL leads to my own thumbnail page.  Clicking on an image launches the slideshow starting on the index of the clicked image.  Do this on an iPhone.


FYI: There are two ways to reach my slideshows should you want to see a comparison when I use and don't use firstImageIndex

(1) Navigate to http://www.jasonwinshell.com/content/work.jsp
- you will see a list of photo galleries
- a play button appears below each gallery title photo
- a thumbnail grid icon appears to the right of each gallery title photo

(2) click on the play arrow runs SVP using the stock index.html  (no firstImageIndex)

OR

(2) click on the thumbnail grid icon to right of gallery title photo
- this leads to a thumbnail page
- click an image to launch SVP with firstImageIndex

Re: bizarre behavior on mobile with use of flashvars.firstImageIndex

Your gallery index pages do not use Doctype Declarations.
Put the following code at the beginning of each gallery index page, before the opening <html> tag:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

I have tried this in a test gallery and it should solve the problem.

Steven Speirs
SimpleViewer Support Team.

Re: bizarre behavior on mobile with use of flashvars.firstImageIndex

Beautiful.   It works.  But why?  What was going on.  I'm dying to know.

Thanks.

Jason

Re: bizarre behavior on mobile with use of flashvars.firstImageIndex

Here's a quote from this page: http://www.w3schools.com/html/html_doctype.asp

The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers render the content correctly.

See also this page for further information: http://www.w3.org/QA/Tips/Doctype

Steven Speirs
SimpleViewer Support Team.

Re: bizarre behavior on mobile with use of flashvars.firstImageIndex

Not a bug, but I noticed that when playing on an iPhone it's possible bring the browser location bar back down (it's initially hidden) by tap on the top of the screen where the battery indicator is shown.  The slideshow is partially pushed downward, obscuring the bottom part of the current image.  Apple uses that area as  trick for scrolling web pages to the top.  Is it possible to hide it again?

Re: bizarre behavior on mobile with use of flashvars.firstImageIndex

Perhaps a web search would prove useful as this seems to be an iPhone/iPod issue rather than specifically with SimpleViewer.
There are many web pages explaining how to hide the address bar when initially loading a page (via JavaScript on the page itself) but I have not yet discovered how to hide the address bar after tapping to manually display it.

Steven Speirs
SimpleViewer Support Team.