Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #21 from avalonmediasystem/develop
Browse files Browse the repository at this point in the history
Parser update in returning thumbnail, comment out link to external ma…
  • Loading branch information
adamjarling authored Nov 14, 2017
2 parents d8cccc0 + 88932b2 commit f3f0ca9
Show file tree
Hide file tree
Showing 5 changed files with 4,687 additions and 676 deletions.
7 changes: 6 additions & 1 deletion app/iiif_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,15 @@ export default class IIIFParser {
* @return {string} URI of thumbnail or an empty string if not found
*/
getCanvasPoster (canvases, canvasId) {
let thumbnailUri = ''
const canvas = canvases.find((canvas) => {
return canvas.id === canvasId
})

return (canvas) ? canvas.thumbnail[0].id : ''
if (canvas.thumbnail && canvas.thumbnail[0].id) {
thumbnailUri = canvas.thumbnail[0].id
}

return thumbnailUri
}
}
9 changes: 7 additions & 2 deletions build/iiif-player-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -19499,7 +19499,7 @@ var IIIFParser = function () {
}, {
key: 'getFirstContentObj',
value: function getFirstContentObj(canvases) {
return canvases[0].content[0];
return canvases[0].items[0];
}

/**
Expand Down Expand Up @@ -19643,11 +19643,16 @@ var IIIFParser = function () {
}, {
key: 'getCanvasPoster',
value: function getCanvasPoster(canvases, canvasId) {
var thumbnailUri = '';
var canvas = canvases.find(function (canvas) {
return canvas.id === canvasId;
});

return canvas ? canvas.thumbnail[0].id : '';
if (canvas.thumbnail && canvas.thumbnail[0].id) {
thumbnailUri = canvas.thumbnail[0].id;
}

return thumbnailUri;
}
}]);

Expand Down
2 changes: 1 addition & 1 deletion build/iiif-player-bundle.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h3 class="version-title">Avalon IIIF A/V MediaElement Player v.1.0</h3>
</header>

<article class="alert alert-secondary">
<p><strong>Note:</strong> Currently the master branch represents parsing of a manifest with the following structure: <a href="https://mallorn.dlib.indiana.edu/media_objects/0c483j54d/manifest" target="_blank">https://mallorn.dlib.indiana.edu/media_objects/0c483j54d/manifest</a> To get started, copy and paste this url below and click 'Submit'. There's a current MediaElement4 / hls issue in this app which will only render one MediaElement player per page load.</p>
<p><strong>Sample manifest:</strong> <a href="https://mallorn.dlib.indiana.edu/media_objects/0c483j54d/manifest" target="_blank">https://mallorn.dlib.indiana.edu/media_objects/0c483j54d/manifest</a> To get started, copy and paste this url below and click 'Submit'. Note we're experiencing issues with the rendering in MediaElement 4 at the moment, and working on a fix.</p>
</article>

<!-- Alert message -->
Expand Down Expand Up @@ -60,10 +60,12 @@ <h4>Current Manifest</h4>
<pre id="current-manifest-pre" class="alert alert-secondary"></pre>
</section>

<!--
<div>
<h4>Other test manifest files:</h4>
<a href="https://github.com/avalonmediasystem/avalon-iiif-player/wiki/IIIF-AV-Sample-Manifests" target="_blank">https://github.com/avalonmediasystem/avalon-iiif-player/wiki/IIIF-AV-Sample-Manifests</a>
</div>
-->

</div>

Expand Down
Loading

0 comments on commit f3f0ca9

Please sign in to comment.