Universal Viewer should show only things that it can render / IIIF manifest should only include images
Descriptive summary
If there is a mix of content attached to a work, including images, Universal Viewer attempts to show them all in the viewer. Those is cannot render display as an endless spinning grey square. This is happening because all objects are going into the IIIF manifest, but only images can be rendered this way.
Expected behavior
Only show things that Universal Viewer can render
Actual behavior
Viewer spins on things it cannot render.
Steps to reproduce the behavior
- Upload several items to a Work including at least one image
- View the work
Related work
#1170 related issue on display of access restricted items in Universal Viewer
This should probably be reworded to say, "only image files should go into the IIIF manifest for a work".
@jcoyne Can you estimate the level of effort needed in this issue?
@mjgiarlo 1/2 day.
I've renamed this one. Thanks! Does UV support audio/video? If yes, then maybe those should also be included?
@geekscruff UniversalViewer.io says that UV also supports 3D objects, PDFs, audio, and video. I'm not sure there's a good way to tell if a thing will work in UV or not. Is there?
See also; https://universalviewer.gitbooks.io/custom-extensions/content/extensions_and_modules.html
In light of this, would you revise your effort estimate, @jcoyne?
As it currently stands, I'm pretty sure that PDFs don't work in amongst images. But no, I don't think there would be an automated way to check something works, unless the viewer returns some kind of error that could be handled?
I can do a bit more testing with other object types.
It would be nice to support more object types with the extensions tho, which I guess makes this a bit more EPIC and in need of more design and discussion.
Out of interest, what is it that makes the UV display, is it the existence of a manifest?
@mjgiarlo There's still going to be things that UV can't handle, and we ought to take care of them. So that's still 1/2 day. Using the native players (built into Hyrax) is going to be easier than integrating with UV. We may need to upgrade the IIIF manifest API version we are using if we want audio/video/pdf media in UV too. @aeschylus can you tell us what you know about that?
@jcoyne @mjgiarlo I did a bit of research into this yesterday, and including things other than images with UV is handled in a non-IIIF way (with a 'mediaSequences' rather than 'sequences' section - see this gist. I think that in the first instance, we should simply restrict the manifest to images and look at the other types later.
I have time to do some work on this after next Wednesday. Do you have any pointers on how best to approach it? Looking at the code, I thought I could add a method to Hyku::IIIFManifest that takes the file_sets_presenters array and uses solr to identify mime_types and exclude those without an image type.
@geekscruff that sounds like a good plan. I'd take a look at filtering on SolrDocument#image? rather than the mime-type directly.