Topic: Experiences with Flickr and Universal Playback

I'm sure that Steven will correct me if I'm wrong, but I
wanted to document my long slog through the Universal
Playback embeds (hoping that somebody will be helped in the
future).

I think I've modified my code now so that it works the way
I want it to. E.g., see:

http://wickfordyc.org/web/?g=72157628000780561

The description below may help explain some of my missteps
(and attempts to make things simpler) earlier on a different
thread
http://www.simpleviewer.net/forum/viewt … p?id=14980
Also, I had many galleries working with the Universal embed
on another site by putting them in separate directories,
e.g. see http://weiderman.com/albums/Pond/ but not
reflecting the template of the original site.

The first thing I learned is never to mess with svcore
(unless you really know what you are doing).  You may be
able to do more, but it really is not for the faint of
heart.

The Wickford YC index.php has remained the same, but
web/index.php has been updated.  The way the older version
worked (with swfobject.embedSWF() rather than
load.simpleviewier()) was that all the galleries are in one
directory and it uses the fifth parameter (also the GET
parameter to the php code) to specify the gallery (the flikr
set number).  Alas, it was Flash so mobile users could not
see my galleries.  But you cannot use Universal Playback
with all the Mobile galleries in the same directory.
With the Universal embed all the galleries have to be in
separate directories (as it suggests in the documentation).

This is because, with the fifth parameter "true" you say you
want Flash if it is available.  If it is false, you cannot
have these galleries in separate directories (flashvars
parameter) or rename them (from gallery.xml).  So I cannot
have my cake (all the galleries in the same directory) and
eat it too (have the simpleviewer code reflect the template
of the website on small screens).  Well maybe I could, but
that would mean more changes to web/index.php that I would
have to repeat for each directory.

So here's what I did.  First I check whether the device is
iPhone, iPad, iPod, or Android using the USER_AGENT
parameter.  My solution only is one way to check for mobile
devices and thus far it only checks for the devices that are
mentioned in the Universal Playback documentation.
(Presumably other mobile devices can handle the Flash.)  If
it is one of four types of devices, I go to a separate
directory containing that gallery (and losing the template
of the Wickford site).  If not, then I access the gallery
locally, as I did before (e.g no changes to the embed code
other than upgrading the calls to load.sumpleviewer().  My
admin code has to create a new directory and a new gallery
and the new Universal embed code, as well as the same
gallery in the same directory as before.  So the admin code
does the heavy lifting and I have duplicate galleries and
duplicate embed code.  Is there a better way?

Happy to (try) to answer questions.

Re: Experiences with Flickr and Universal Playback

But you cannot use Universal Playback
with all the Mobile galleries in the same directory.

You can, but there will likely be duplicate file names which will have to be dealt with.
You could rename each gallery's XML file from 'gallery.xml' to a unique name and then use a galleryURL to point to each gallery's own XML file as required.
However, I recommended keeping each gallery in its own separate folder for a number of reasons:
(1) It keeps all the galleries separate and it is easy to see, at a glance, which files belong to which gallery.
(2) Updating a gallery would also become easier, requiring that only a single folder needs to be replaced.
(3) No files need to be moved or renamed once the galleries have been built with svBuilder-Pro.
(3) There is already a mechanism built-in to SimpleViewer (the baseURL option) to embed galleries kept in individual folders.

My solution only is one way to check for mobile
devices and thus far it only checks for the devices that are
mentioned in the Universal Playback documentation.

You might like to, instead, check directly for whether Adobe Flash Player is available or not (rather that check for the device).
This can be done with the following JavaScript code:

if (swfobject.hasFlashPlayerVersion("10.0.0"))
{
    // The required Flash Player version is available. Do something.
}
else
{
    // The required Flash Player version is NOT available. Do something else.
}
Steven Speirs
SimpleViewer Support Team.

Re: Experiences with Flickr and Universal Playback

This answers a lot of questions for me.  I had been assuming (silly me) that because you called the sixth parameter "flashvars" that it would not work for the mobile devices that do not have flash.  But it does!  So that answers the question about separate folders (you don't need them).

The other problem with that solution is the JavaScript error you get when you try to choose the "full screen" button.  It is "undefined ReferenceError: Can't find variable: simpleviewer" and you do not get the full screen functionality.  I want the full screen button for the desktops, but don't care about it for the mobiles.  Can we either have the mobiles ignore the "ShowFullScreen" option or have the JS error go away?  I realize that I can make the option "false" to solve the problem, but then I don't have that option for the desktops.

Lastly, your four recommendations do not apply to those who have their galleries on Flickr or to those who do not use the svBuilder.  All my "galleries" are simple .xml files that I copy unchanged except for the name, set number, and possibly the audio file.  The .xml files get the same name as the set.

Re: Experiences with Flickr and Universal Playback

The other problem with that solution is the JavaScript error you get when you try to choose the "full screen" button.  It is "undefined ReferenceError: Can't find variable: simpleviewer" and you do not get the full screen functionality.  I want the full screen button for the desktops, but don't care about it for the mobiles.  Can we either have the mobiles ignore the "ShowFullScreen" option or have the JS error go away?  I realize that I can make the option "false" to solve the problem, but then I don't have that option for the desktops.

Options can be set via flashvars in the embedding code instead of as attributes to the opening <simpleviewergallery> tag in the gallery's XML file so to disable the Fullscreen button in the Mobile Player, remove the showFullscreenButton option from the gallery's XML file and use the following embedding code:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars={};
flashvars.showFullscreenButton=false;
if (swfobject.hasFlashPlayerVersion("10.0.0"))
{
    flashvars.showFullscreenButton=true;
}
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

Lastly, your four recommendations do not apply to those who have their galleries on Flickr or to those who do not use the svBuilder.  All my "galleries" are simple .xml files that I copy unchanged except for the name, set number, and possibly the audio file.  The .xml files get the same name as the set.

I realise this is not a problem for yourself but for others, there may still be one benefit to keeping galleries (even Flickr galleries) in separate folders.
Each Flickr gallery will have a 'gallery.xml' file and if embedding using <iframe>s an 'index.html' file, too.
Keeping each gallery in a separate folder would prevent users from having to rename these files to avoid duplicate file names.
Incidentally, with reference to your query above, if embedding using an <iframe> the Fullscreen Button is automatically disabled for the Mobile Player.

Steven Speirs
SimpleViewer Support Team.